API

Class Animatable

Class used to store an actual running animation

Index
  • Creates a new Animatable

    Parameters

    • scene: Scene

      defines the hosting scene

    • target: any

      defines the target object

    • fromFrame: number = 0

      defines the starting frame number (default is 0)

    • toFrame: number = 100

      defines the ending frame number (default is 100)

    • loopAnimation: boolean = false

      defines if the animation must loop (default is false)

    • speedRatio: number = 1.0

      defines the factor to apply to animation speed (default is 1)

    • OptionalonAnimationEnd: any

      defines a callback to call when animation ends if it is not looping

    • Optionalanimations: Animation[]

      defines a group of animation to add to the new Animatable

    • OptionalonAnimationLoop: any

      defines a callback to call when animation loops

    • isAdditive: boolean = false

      defines whether the animation should be evaluated additively

    • playOrder: number = 0

      defines the order in which this animatable should be processed in the list of active animatables (default: 0)

    Returns Animatable

animationStarted: boolean = false

Gets a boolean indicating if the animation has started

disposeOnEnd: boolean = true

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)

fromFrame: number = 0

[0] defines the starting frame number (default is 0)

isAdditive: boolean = false

[false] defines whether the animation should be evaluated additively

loopAnimation: boolean = false

[false] defines if the animation must loop (default is false)

onAnimationEnd?: any

defines a callback to call when animation ends if it is not looping

onAnimationEndObservable: any = ...

Observer raised when the animation ends

onAnimationLoop?: any

defines a callback to call when animation loops

onAnimationLoopObservable: any = ...

Observer raised when the animation loops

playOrder: number = 0

[0] defines the order in which this animatable should be processed in the list of active animatables (default: 0)

target: any

defines the target object

toFrame: number = 100

[100] defines the ending frame number (default is 100)

ProcessPausedAnimatables: boolean = false

If true, the animatable will be processed even if it is considered actively paused (weight of 0 and previous weight of 0). This can be used to force the full processing of paused animatables in the animation engine. Default is false.

  • Jump directly to a given frame

    Parameters

    • frame: number

      defines the frame to jump to

    • useWeight: boolean = false

      defines whether the animation weight should be applied to the image to be jumped to (false by default)

    Returns void

  • Stop and delete the current animation

    Parameters

    • OptionalanimationName: string

      defines a string used to only stop some of the runtime animations instead of all

    • OptionaltargetMask: (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)

    • useGlobalSplice: boolean = false

      if true, the animatables will be removed by the caller of this function (false by default)

    • skipOnAnimationEnd: boolean = false

      defines if the system should not raise onAnimationEnd. Default is false

    Returns void