transition()
Calculates transition progress over a specified duration with optional easing.Parameters
number
required
Current frame number
number
required
Frame to start the transition
number
required
Duration of the transition in frames
TransitionOptions
Optional transition configuration
Returns
number - Progress value:
0before start frame0to1during transition1after transition completes
Examples
Basic fade in
With easing
Delayed transition
Scale transition
crossfade()
Calculates opacity values for crossfading between two elements.Parameters
number
required
Current frame number
number
required
Frame to start the crossfade
number
required
Duration of the crossfade in frames
TransitionOptions
Optional transition configuration
Returns
CrossfadeResult object with:
number
Opacity for the incoming element (0 to 1)
number
Opacity for the outgoing element (1 to 0)