Class Tweenable

Hierarchy

  • Tweenable

Constructors

Properties

easing: Record<string, EasingFunction> = ...

You can define custom easing curves by attaching EasingFunctions to this static object.

Tweenable.easing['customEasing'] = (pos: number) => Math.pow(pos, 2)
filters: Record<string, Filter> = ...

The Filters available for use. These filters are automatically applied. You can define your own Filters and attach them to this object.

Tweenable.filters['customFilter'] = {
doesApply: () => true
tweenCreated: () => console.log('tween created!')
}

Accessors

  • get hasEnded(): boolean
  • Whether or not a tween has completed.

    Returns boolean

  • get isPlaying(): boolean
  • Whether or not a tween is running (not paused or completed).

    Returns boolean

Methods

  • delete all own properties. Call this when the Tweenable instance is no longer needed to free memory.

    Returns void

  • Move the state of the animation to a specific point in the tween's timeline. If the animation is not running, this will cause the tween's render handler to be called.

    Parameters

    • millisecond: number

      The millisecond of the animation to seek to. This must not be less than 0.

    Returns Tweenable

  • Stops a tween. If a tween is not running, this is a no-op. This method does not reject the tween Promise. For that, use cancel.

    Parameters

    • gotoEnd: boolean = false

      If false or not provided, the tween just stops at its current state. If true, the tweened object's values are instantly set to the target values.

    Returns Tweenable

Generated using TypeDoc