python-lottie  0.6.11+devc144cca
A framework to work with lottie files and telegram animated stickers (tgs)
lottie.objects.shapes.Rect Class Reference

A simple rectangle shape. More...

Inheritance diagram for lottie.objects.shapes.Rect:
Collaboration diagram for lottie.objects.shapes.Rect:

Public Member Functions

def __init__ (self, pos=None, size=None, rounded=0)
def bounding_box (self, time=0)
 Bounding box of the shape element at the given time. More...
def to_bezier (self)
 Returns a Shape corresponding to this rect. More...
- Public Member Functions inherited from lottie.objects.shapes.Shape
def __init__ (self)
- Public Member Functions inherited from lottie.objects.shapes.ShapeElement
def __str__ (self)
- Public Member Functions inherited from lottie.objects.base.LottieObject
def to_dict (self)
 Serializes into a JSON object fit for the Lottie format. More...
def load (cls, lottiedict)
 Loads from a JSON object. More...
def find (self, search, propname="name")
 Recursively searches for child objects with a matching property. More...
def find_all (self, type, predicate=None, include_self=True)
 Find all child objects that match a predicate. More...
def clone (self)
 Returns a copy of the object. More...
def clone_into (self, other)
- Public Member Functions inherited from lottie.objects.base.LottieObjectMeta
def __new__ (cls, name, bases, attr)

Public Attributes

 Rect's position. More...
 Rect's size. More...
 Rect's rounded corners. More...
- Public Attributes inherited from lottie.objects.shapes.Shape
 After Effect's Direction. More...
- Public Attributes inherited from lottie.objects.shapes.ShapeElement
 Property index. More...
 Hide element. More...
 Blend mode. More...
- Public Attributes inherited from lottie.objects.helpers.VisualObject

Static Public Attributes

string type = "rc"
 Shape type. More...
- Static Public Attributes inherited from lottie.objects.shapes.ShapeElement
 type = None
 Shape type. More...

Detailed Description

A simple rectangle shape.

Lottie JSON
Lottie name Type Description Attribute
nm str   name
mn str   match_name
hd bool Hide element.   hidden
ty str = 'rc' Shape type.   type
cix int Property index.   property_index
bm BlendMode Blend mode.   blend_mode
d ShapeDirection After Effect's Direction.   direction
p PositionValue Rect's position.   position
s MultiDimensional Rect's size.   size
r Value Rect's rounded corners.   rounded

Definition at line 149 of file

Constructor & Destructor Documentation

◆ __init__()

def lottie.objects.shapes.Rect.__init__ (   self,
  pos = None,
  size = None,
  rounded = 0 

Definition at line 161 of file

Member Function Documentation

◆ bounding_box()

def lottie.objects.shapes.Rect.bounding_box (   self,
  time = 0 

Bounding box of the shape element at the given time.

Reimplemented from lottie.objects.shapes.ShapeElement.

Definition at line 170 of file

◆ to_bezier()

def lottie.objects.shapes.Rect.to_bezier (   self)

Returns a Shape corresponding to this rect.

Reimplemented from lottie.objects.shapes.Shape.

Definition at line 181 of file

Member Data Documentation

◆ position


Rect's position.

Definition at line 164 of file

◆ rounded


Rect's rounded corners.

Definition at line 168 of file

◆ size


Rect's size.

Definition at line 166 of file

◆ type

string lottie.objects.shapes.Rect.type = "rc"

Shape type.

Definition at line 159 of file

The documentation for this class was generated from the following file: