python-lottie  0.6.10+dev2509936
A framework to work with lottie files and telegram animated stickers (tgs)
round.py
1 #!/usr/bin/env python3
2 import sys
3 import os
4 sys.path.insert(0, os.path.join(
5  os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
6  "lib"
7 ))
8 from lottie.utils import script
9 from lottie import objects
10 from lottie import Point, Color
11 
12 
13 last_frame = 180
14 an = objects.Animation(last_frame)
15 
16 layer = objects.ShapeLayer()
17 an.add_layer(layer)
18 
19 group = layer.add_shape(objects.Group())
20 
21 star = group.add_shape(objects.Star())
22 star.inner_radius.value = 40
23 star.outer_radius.value = 100
24 star.position.value = Point(256, 256)
25 
26 star = group.add_shape(objects.Star())
27 star.inner_radius.value = 20
28 star.outer_radius.value = 50
29 star.position.value = Point(256, 256)
30 
31 round = layer.add_shape(objects.RoundedCorners())
32 round.radius.add_keyframe(0, 0)
33 round.radius.add_keyframe(last_frame/2, 30)
34 round.radius.add_keyframe(last_frame, 0)
35 
36 stroke = group.add_shape(objects.Stroke(Color(1, 1, 0), 10))
37 
38 
39 script.script_main(an)
40 
lottie.nvector.Point
def Point(x, y)
Definition: nvector.py:135
lottie.utils
Definition: __init__.py:1