File indexing completed on 2025-01-19 04:00:01

0001 #!/usr/bin/env python3
0002 """
0003 @note Text layers are not supported by telegram
0004 """
0005 import sys
0006 import os
0007 sys.path.insert(0, os.path.join(
0008     os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
0009     "lib"
0010 ))
0011 from lottie.utils import script
0012 from lottie import objects
0013 from lottie import Color, Point
0014 
0015 
0016 an = objects.Animation(120)
0017 an.fonts = objects.text.FontList()
0018 an.fonts.append(objects.text.Font("sans", name="sans"))
0019 layer = objects.TextLayer()
0020 an.add_layer(layer)
0021 
0022 layer.data.add_keyframe(0, objects.text.TextDocument("Text", 200, Color(1, 0, 0), "sans"))
0023 layer.data.add_keyframe(60, objects.text.TextDocument("Here", 200, Color(0, 1, 0), "sans"))
0024 layer.transform.position.value = Point(30, 200)
0025 
0026 
0027 script.script_main(an)