Skip to content

aninest root / AnimatableEvents

AnimatableEvents

Various ways to attach and detach event listeners to an Animation.

Index

Type Aliases

Type aliasDescription
AnimatableListenerListens to the animation for a specific event. All events aside from update return a dictionary of local values which are currently being animated.

Variables

VariableDescription
ANIM_TYPES_WITH_VALUEList of event types which provide the values which the animation is interpolating to (or in the case of end the final values).

Functions

FunctionDescription
addLocalListenerAdds a local listener to the animation. You can listen to the events listed in AnimatableEvents. Animation listeners are scoped to only trigger when the current level of the animation is modified. Animation listeners are called in the order in which they were added.
addRecursiveListenerAdds a recursive start listener to the animation. This listener will trigger on any child modification. Animation listeners are called in the order in which they were added.
removeLocalListenerRemoves a listener from the animation
removeRecursiveListenerRemoves a recursive start listener from the animation

EventTypes

Type alias, VariableDescription
AnimatableEventsThe collection of events which can be listened to on an animation. Returns undefined
AnimatableEventsWithValueAnimation Events which return the values which the animation is interpolating to. Only excludes the update event.
BEFORE_ENDBroadcasts right before the animation ends to allow for the animation to be interrupted before it ends. This is useful to create snapping, looping, or bouncing animations without triggering any END events.
BEFORE_STARTBroadcasts before the animation recurses into its children to update their values. Only broadcasted if there is a local change to the animation at the level this event is attached to.
ENDBroadcasts at the end of an interpolation, excluding any interruptions triggered before the animation fully comes to rest, including interruptions created on the BEFORE_END event.
IMMUTABLE_STARTSame as START but by convention no modifyTo calls should be made in any listeners attached to this event. This is useful for extensions which need to know when the animation is starting such as the proxy extension but which don't need to trigger any modifications to any animation states.
INTERRUPTBroadcasts when a new target state is set while the animation is not at its resting state yet. This event is useful for reverting any changes made to the animation state before continuing the animation. See the momentum extension for an example of this.
STARTBroadcasts after an animation's target state is set to a new value.
UPDATEBroadcasts every time the animation state's time is updated so long as the animation is running.