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