Frame-clock driven animation system.
Animations are driven by the frame clock, not by setInterval. This ensures smooth, jank-free animations that are synchronized with the render pipeline.
Architecture:
FrameClock → AnimationSystem → SceneGraph UpdateExample
# Animate a node's opacity from 0 to 1 over 500ms
Dala.Media.Animation.animate(scene, node_id, :opacity, %{
from: 0.0,
to: 1.0,
duration_ms: 500,
easing: :ease_in_out
})
# Animate position
Dala.Media.Animation.animate(scene, node_id, :position, %{
from: {0, 0},
to: {100, 200},
duration_ms: 1000,
easing: :spring
})
Summary
Functions
Animate a property on a scene node.
Cancel an animation.
Cancel all animations for a node.
Returns a specification to start this module under a supervisor.
Start the animation system, linked to a clock.
Types
@type anim_ref() :: pid()
@type easing() :: :linear | :ease_in | :ease_out | :ease_in_out | :spring | :bounce
Functions
Animate a property on a scene node.
Cancel an animation.
Cancel all animations for a node.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
Start the animation system, linked to a clock.