Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TweenAnimate

Animates a number from one value to another, with optional tweening.

Hierarchy

  • TweenAnimate

Implements

Index

Constructors

constructor

  • Parameters

    • duration: number

      How long is the tween

    • from: number

      Starting value

    • to: number

      Final value

    • updateCallback: function

      Function to call on each advance with the new number vlaue

        • (i: number): void
        • Parameters

          • i: number

          Returns void

    • Default value easing: EasingCallback | undefined = undefined

      Optional easing function

    • Default value finishedCallback: VoidCallback | undefined = undefined

      Function to call when the tween finishes

    Returns TweenAnimate

Accessors

duration

  • get duration(): number
  • Returns number

isFinished

  • get isFinished(): boolean
  • Returns boolean

remainingDuration

  • get remainingDuration(): number
  • Duration remaining for this tween to run

    Returns number

Methods

advance

  • advance(durationToAdvance: number): number
  • Advances the tween by the given duration and calls the update callback with the new value for the number.

    Parameters

    • durationToAdvance: number

      Duration to spend on this tween.

    Returns number

    Returns the duration consumed by this tween.

finish

  • finish(): void
  • Instantly finishes the tween, calling the update callback with the final value and calling the finished callback if it was provided, identical to calling advance() with remainingDuration

    Returns void

skip

  • skip(): void
  • Instantly finishes the tween and does not call the update callback nor the finished callback.

    Returns void

Generated using TypeDoc