python-lottie  0.6.10+dev2509936
A framework to work with lottie files and telegram animated stickers (tgs)
simple_shapes.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 an = objects.Animation(59)
14 
15 layer = objects.ShapeLayer()
16 an.add_layer(layer)
17 
18 circle = layer.add_shape(objects.Ellipse())
19 circle.size.value = Point(100, 100)
20 circle.position.value = Point(220, 110)
21 
22 star = layer.add_shape(objects.Star())
23 star.inner_radius.value = 20
24 star.outer_radius.value = 50
25 star.position.value = Point(330, 110)
26 
27 rect = layer.add_shape(objects.Rect())
28 rect.size.value = Point(100, 100)
29 rect.position.value = Point(110, 110)
30 
31 
32 rrect = layer.add_shape(objects.Rect())
33 rrect.size.value = Point(100, 100)
34 rrect.position.value = Point(110, 220)
35 rrect.rounded.value = 30
36 
37 fill = layer.add_shape(objects.Fill(Color(1, 1, 0)))
38 stroke = layer.add_shape(objects.Stroke(Color(0, 0, 0), 25))
39 
40 
41 script.script_main(an)
lottie.nvector.Point
def Point(x, y)
Definition: nvector.py:135
lottie.utils
Definition: __init__.py:1