python-lottie  0.7.0+devbe239c9
A framework to work with lottie files and telegram animated stickers (tgs)
text.py
Note
Text layers are not supported by telegram
1 #!/usr/bin/env python3
2 """
3 @note Text layers are not supported by telegram
4 """
5 import sys
6 import os
7 sys.path.insert(0, os.path.join(
8  os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
9  "lib"
10 ))
11 from lottie.utils import script
12 from lottie import objects
13 from lottie import Color, Point
14 
15 
16 an = objects.Animation(120)
17 an.fonts = objects.text.FontList()
18 an.fonts.append(objects.text.Font("sans", name="sans"))
19 layer = objects.TextLayer()
20 an.add_layer(layer)
21 
22 layer.data.add_keyframe(0, objects.text.TextDocument("Text", 200, Color(1, 0, 0), "sans"))
23 layer.data.add_keyframe(60, objects.text.TextDocument("Here", 200, Color(0, 1, 0), "sans"))
24 layer.transform.position.value = Point(30, 200)
25 
26 
27 script.script_main(an)
def Point(x, y)
Definition: nvector.py:135