BaseVElement
BaseVElement
Abstract base class for all animatable elements
Provides shared keyframe animation logic for Element and ContainerElement.
Constructor
BaseVElement(self, state: 'Optional[State]' = None, states: 'Optional[List[State]]' = None, keyframes: 'Optional[List[Tuple[float, State]]]' = None, easing: 'Optional[Dict[str, Callable[[float], float]]]' = None) -> 'None'
Initialize keyframe animation system
Args: state: Single state for static element states: List of states for evenly-timed animation keyframes: List of (frame_time, state) tuples for precise timing easing: Optional dict to override default easing functions
Methods
is_animatable(self) -> 'bool'
Check if this element can be animated
Returns: True if element has multiple keyframes
render(self) -> 'dw.DrawingElement'
Render the element in its initial state (static rendering)
Returns: drawsvg element representing the element
render_at_frame_time(self, t: 'float') -> 'dw.DrawingElement'
Render the element at a specific animation time
Args: t: Time factor from 0.0 to 1.0
Returns: drawsvg element representing the element at time t
set_keyframes(self, keyframes: 'List[Tuple[float, State]]') -> 'None'
Set explicit keyframes
set_state(self, state: 'State') -> 'None'
Set a single static state
set_states(self, states: 'List[State]') -> 'None'
Set evenly-timed states