AnimationComponent

Native animation component.

Provides access to a native animation component instance.

.onEvent: Emitter<[string]> 

Emitter for animation events triggered on this component.

The first argument is the name of the event.

.TypeName: string 

.animation: null | Animation 

Animation set for this component

.animation 

Set animation to play.

Make sure to retarget the animation to affect the right objects.

.playCount: number 

Number of times the animation is played.

.playCount 

Set play count. Set to 0 to loop indefinitely.

.speed: number 

0.8.5+

Speed factor at which the animation is played.

.speed 

0.8.5+

Set speed. Set to negative values to run the animation backwards.

Setting speed has an immediate effect for the current frame’s update and will continue with the speed from the current point in the animation.

.state: AnimationState 

Current playing state of the animation

.getFloatParameter(name: string) ⇒ null | number 

0.8.5+

Get the value of a float parameter in the attached graph. Throws if the parameter is missing.

ParamTypeDescription
namestringName of the parameter.

.pause() ⇒ void 

Pause animation.

.play() ⇒ void 

Play animation.

If the animation is currently paused, resumes from that position. If the animation is already playing, does nothing.

To restart the animation, stop it first.

.setFloatParameter(name: string, value: number) ⇒ void 

0.8.5+

Set the value of a float parameter in the attached graph Throws if the parameter is missing.

Returns: 1 if the parameter was successfully set, 0 on fail.

ParamTypeDescription
namestringName of the parameter.
valuenumberFloat value to set.

.stop() ⇒ void 

Stop animation.