API

Function AnimationCreateAndStartAnimation

  • Create and start an animation on a node

    Parameters

    • name: string

      defines the name of the global animation that will be run on all nodes

    • target: any

      defines the target where the animation will take place

    • targetProperty: string

      defines property to animate

    • framePerSecond: number

      defines the number of frame per second yo use

    • totalFrame: number

      defines the number of frames in total

    • from: any

      defines the initial value

    • to: any

      defines the final value

    • OptionalloopMode: number

      defines which loop mode you want to use (off by default)

    • OptionaleasingFunction: EasingFunction

      defines the easing function to use (linear by default)

    • OptionalonAnimationEnd: () => void

      defines the callback to call when animation end

    • Optionalscene: Scene

      defines the hosting scene

    Returns Nullable<Animatable>

    the animatable created for this animation