Animator
Class | Type | Name | Interface Description |
---|---|---|---|
Animator:Component | Variables | animations: Animation[] | List of animation resources associated with the component |
playback:Animation | The currently playing animation (when playing/switching animations by setting this property, the default playback parameters configured on the animation resource will be used) | ||
Functions | getAnimation(name: string): Animation | Get animation by name | |
pauseAll():void | Pause Animation | ||
resumeAll():void | Resume Animation Playback | ||
stopAll():void | Stop Animation | ||
play(animationName: string, wrapMode: number|AnimationWrapMode, speed: number, fadeInTime: number):void | Play animation. When playing/switching animations by calling this function, the playback parameters passed in the arguments will be used. Parameters: • Animation Name • Play mode (can pass in AnimationWrapMode or a number greater than 0, where the value greater than 0 represents the number of animation loops) • Playback speed • Transition time when switching animations |
Examples
animations: Animation[]
animator.animations = otherAnimations
playback:Animation
animator.playback = targetAnimation
getAnimation(name: string): Animation
let animation = animator.getAnimation(animationName)
pauseAll():void
animator.pauseAll();
resumeAll():void
animator.resumeAll();
stopAll():void
animator.stopAll();
play(animationName: string, wrapMode: number|AnimationWrapMode, speed: number, fadeInTime: number):void
animator.play(animationName, APJS.AnimationWrapMode.Repeat, speed, 0);