movis.layer.drawing.Rectangle#
- class movis.layer.drawing.Rectangle(size: tuple[float, float] = (100.0, 100.0), radius: float = 0.0, color: tuple[int, int, int] | str | None = None, contents: Sequence[FillProperty | StrokeProperty] = (), duration: float = 1000000.0)[source]#
Draw a rectangle with rounded corners.
- Args:
- size:
The size of the rectangle with a tuple of
(width, height).- radius:
The radius of the rounded corners. The default value is
0.- color:
The color of the rectangle with a tuple of
(r, g, b)or a string (e.g.,"#ff0000" or "red"). IfNone, this layer uses thecontentsargument to draw the rectangle.- contents:
A sequence of
FillPropertyorStrokePropertyobjects, which will be drawn on top of the rectangle. If an empty sequence is given, the rectangle will be filled with thecolorargument.- duration:
The duration for which the rectangle should be displayed.
- Animateable Attributes:
sizeradius
Methods
- get_key(time: float) tuple[Hashable, ...]#
Returns a tuple of hashable values that represent the state of the instance at a given time.
Attributes
attributesA dictionary of attributes that are used to generate cache keys.
duration