Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Tween
    • GeometricObjectTween

Index

Constructors

constructor

Methods

addMotion

  • addMotion(key: string, target: number, duration: number, easing?: string): Tween
  • Adds a new motion to the tween object. When the tween is playing it will change the the defined key of the given object to make an animation.

    Parameters

    • key: string

      expects the name of the effected key of the given object from constructor

    • target: number

      expects the value for ending postion if this motion

    • duration: number

      expects the duration of this motion in milliseconds

    • Default value easing: string = "linear"

      optional: the name of the easing-function (default is 'linear')

    Returns Tween

addMotionTo

  • addMotionTo(object: { angle?: number; h?: number; height?: number; rotation?: number; w?: number; width?: number; x?: number; y?: number }, duration: number, easing?: string): void
  • Parameters

    • object: { angle?: number; h?: number; height?: number; rotation?: number; w?: number; width?: number; x?: number; y?: number }
      • Optional angle?: number
      • Optional h?: number
      • Optional height?: number
      • Optional rotation?: number
      • Optional w?: number
      • Optional width?: number
      • Optional x?: number
      • Optional y?: number
    • duration: number
    • Default value easing: string = "linear"

    Returns void

addMotions

  • addMotions(actions: { key: string; target: number }[], duration: number, easing?: string): Tween
  • Adds a new combined motion to the tween objects. In actions are some motions combined, which should be changed in the same time. When the tween is playing it will change the the defined key of the given object to make an animation.

    Parameters

    • actions: { key: string; target: number }[]

      expects an array of key-target pairs for this motion

    • duration: number

      expects the duration of this motion in milliseconds

    • Default value easing: string = "linear"

      optional: the name of the easing-function (default is 'linear')

    Returns Tween

onEnd

  • onEnd(listener: Function): Tween
  • Sets a function which is called when the tween is over.

    Parameters

    • listener: Function

      expects a function or lambda which should be executed. The function has one argument which represents the tween it self.

    Returns Tween

onLoop

  • onLoop(listener: Function): Tween
  • Sets a function which is called every time the tween has played a complete loop.

    Parameters

    • listener: Function

      expects a function or lambda which should be executed. The function has one argument which represents the tween it self.

    Returns Tween

pause

resetMotions

  • resetMotions(): void

restart

resume

startLoop

startTween

update

  • update(deltaTime: number): void

Generated using TypeDoc