Class Animatable
Hierarchy
- Animatable
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
Creates a new Animatable
Parameters
scene: Scene
defines the hosting scene
target: any
defines the target object
Optional fromFrame: number
defines the starting frame number (default is 0)
Optional toFrame: number
defines the ending frame number (default is 100)
Optional loopAnimation: boolean
defines if the animation must loop (default is false)
Optional speedRatio: number
defines the factor to apply to animation speed (default is 1)
Optional onAnimationEnd: Nullable<(() => void)>
defines a callback to call when animation ends if it is not looping
Optional animations: Animation[]
defines a group of animation to add to the new Animatable
Optional onAnimationLoop: Nullable<(() => void)>
defines a callback to call when animation loops
Optional isAdditive: boolean
defines whether the animation should be evaluated additively
Optional playOrder: number
defines the order in which this animatable should be processed in the list of active animatables (default: 0)
Returns Animatable
Properties
animation StartedSearch playground for animationStarted
Gets a boolean indicating if the animation has started
dispose On EndSearch playground for disposeOnEnd
Gets or sets a boolean indicating if the animatable must be disposed and removed at the end of the animation. This will only apply for non looping animation (default is true)
from FrameSearch playground for fromFrame
defines the starting frame number (default is 0)
is AdditiveSearch playground for isAdditive
defines whether the animation should be evaluated additively
loop AnimationSearch playground for loopAnimation
defines if the animation must loop (default is false)
Optional on Animation EndSearch playground for onAnimationEnd
defines a callback to call when animation ends if it is not looping
on Animation End ObservableSearch playground for onAnimationEndObservable
Observer raised when the animation ends
Optional on Animation LoopSearch playground for onAnimationLoop
defines a callback to call when animation loops
on Animation Loop ObservableSearch playground for onAnimationLoopObservable
Observer raised when the animation loops
play OrderSearch playground for playOrder
defines the order in which this animatable should be processed in the list of active animatables (default: 0)
targetSearch playground for target
defines the target object
to FrameSearch playground for toFrame
defines the ending frame number (default is 100)
Accessors
master Frame
Gets the current frame of the first RuntimeAnimation Used to synchronize Animatables
Returns number
paused
Returns true if the animations for this animatable are paused
Returns boolean
speed Ratio
Gets or sets the speed ratio to apply to the animatable (1.0 by default)
Returns number
Gets or sets the speed ratio to apply to the animatable (1.0 by default)
Parameters
value: number
Returns void
sync Root
Gets the root Animatable used to synchronize and normalize animations
Returns Nullable<Animatable>
weight
Gets or sets the animatable weight (-1.0 by default meaning not weighted)
Returns number
Gets or sets the animatable weight (-1.0 by default meaning not weighted)
Parameters
value: number
Returns void
Methods
append AnimationsSearch playground for appendAnimations
Adds more animations to the current animatable
Parameters
target: any
defines the target of the animations
animations: Animation[]
defines the new animations to add
Returns void
disable BlendingSearch playground for disableBlending
Disable animation blending
Returns void
enable BlendingSearch playground for enableBlending
Allows the animatable to blend with current running animations
Parameters
blendingSpeed: number
defines the blending speed to use
Returns void
get Animation By Target PropertySearch playground for getAnimationByTargetProperty
get AnimationsSearch playground for getAnimations
Gets the list of runtime animations
Returns RuntimeAnimation[]
an array of RuntimeAnimation
get Runtime Animation By Target PropertySearch playground for getRuntimeAnimationByTargetProperty
Gets the runtime animation for a specific property
Parameters
property: string
defines the property to look for
Returns Nullable<RuntimeAnimation>
null or the runtime animation for the given property
go To FrameSearch playground for goToFrame
Jump directly to a given frame
Parameters
frame: number
defines the frame to jump to
Returns void
pauseSearch playground for pause
Pause the animation
Returns void
resetSearch playground for reset
Resets the animatable to its original state
Returns void
restartSearch playground for restart
Restart the animation
Returns void
stopSearch playground for stop
Stop and delete the current animation
Parameters
Optional animationName: string
defines a string used to only stop some of the runtime animations instead of all
Optional targetMask: ((target: any) => boolean)
a function that determines if the animation should be stopped based on its target (all animations will be stopped if both this and animationName are empty)
Parameters
target: any
Returns boolean
Optional useGlobalSplice: boolean
if true, the animatables will be removed by the caller of this function (false by default)
Returns void
sync WithSearch playground for syncWith
Synchronize and normalize current Animatable with a source Animatable This is useful when using animation weights and when animations are not of the same length
Parameters
root: Nullable<Animatable>
defines the root Animatable to synchronize with (null to stop synchronizing)
Returns Animatable
the current Animatable
wait AsyncSearch playground for waitAsync
Wait asynchronously for the animation to end
Returns Promise<Animatable>
a promise which will be fulfilled when the animation ends
Class used to store an actual running animation