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"). If None, this layer uses the contents argument to draw the rectangle.

contents:

A sequence of FillProperty or StrokeProperty objects, which will be drawn on top of the rectangle. If an empty sequence is given, the rectangle will be filled with the color argument.

duration:

The duration for which the rectangle should be displayed.

Animateable Attributes:

size radius

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

attributes

A dictionary of attributes that are used to generate cache keys.

duration