movis.layer.drawing.Line#
- class movis.layer.drawing.Line(size: tuple[int, int] = (100, 100), start: tuple[float, float] | ndarray = (0.0, 0.0), end: tuple[float, float] | ndarray = (100.0, 100.0), color: tuple[int, int, int] | str = (255, 255, 255), width: float = 1.0, duration: float = 1000000.0)[source]#
Draw a line from
starttoend.- Args:
- size:
The size of the canvas with a tuple of
(width, height).- start:
The start point of the line with a tuple of
(x, y).- end:
The end point of the line with a tuple of
(x, y).- color:
The color of the line with a tuple of
(r, g, b)or a string representing a color name (e.g.,"#ff0000" or "red").- width:
The width of the line.
- duration:
The duration for which the line should be displayed.
- Animateable Attributes:
trim_startThe start point of the line to be drawn in the range of
[0, 1]. The default value is0.trim_endThe end point of the line to be drawn in the range of
[0, 1]. The default value is1.startendcolorwidthThese attributes can be animated as well.
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