rive_rs/animation/
animation_state.rs
1use crate::animation::LayerState;
6use crate::core::{Core, ObjectRef, OnAdded, Property};
7
8#[derive(Debug, Default)]
9pub struct AnimationState {
10 layer_state: LayerState,
11 animation_id: Property<u64>,
12}
13
14impl ObjectRef<'_, AnimationState> {
15 pub fn animation_id(&self) -> u64 {
16 self.animation_id.get()
17 }
18
19 pub fn set_animation_id(&self, animation_id: u64) {
20 self.animation_id.set(animation_id);
21 }
22}
23
24impl Core for AnimationState {
25 parent_types![(layer_state, LayerState)];
26
27 properties![(149, animation_id, set_animation_id), layer_state];
28}
29
30impl OnAdded for ObjectRef<'_, AnimationState> {
31 on_added!(LayerState);
32}