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

  • get state(): TweenState
  • Returns the current state of the tween.

    Returns TweenState

Methods

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

    Returns void

  • Pauses a tween. Paused tweens can be resumed from the point at which they were paused. If a tween is not running, this is a no-op.

    Returns Tweenable

  • 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

  • Set the current tween state.

    Parameters

    Returns void

  • 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

  • Returns the current timestamp.

    Returns number

Generated using TypeDoc