Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Animation

Class for animation handling

property

delta Delta time from start of animation

property

eases Array of Eases animation functions

property

nextAnimations Queue of future animations

property

action Function for handling of interframe modification

property

duration Animation duration in milliseconds

property

easing Ease animation function factory

Index

Constructors

constructor

  • Parameters

    • _values: Array<[number, number]>

      Array of start and end animation values

    • action: AnimationFrameCallback

      Function for handling of interframe modification

    • duration: number

      Animation Duration in milliseconds

    • easing: AnimationEasing

      Ease Animation function factory. See AnimationEasings for a collection of options.

    • _animations: Array<Animation>

    Returns Animation

Properties

Readonly action

Function for handling of interframe modification

delta

delta : number

Readonly duration

duration : number

Animation Duration in milliseconds

eases

eases : Array<Ease>

Readonly easing

easing : AnimationEasing

Ease Animation function factory. See AnimationEasings for a collection of options.

Methods

NextAnimation

  • Add and create animation which has to be executed subsequently

    Parameters

    • values: Array<[number, number]>

      Array of start and end animation values

    • action: AnimationFrameCallback

      Function for handling of interframe modification

    • duration: number

    Returns Animation

    new Animation

addNextAnimations

  • Add animations which has to be executed subsequently

    Parameters

    Returns this

    Object itself for fluent interface

allOffAllAnimationEnd

  • allOffAllAnimationEnd(): this
  • Remove all listeners from All Animation End Event

    Returns this

    Object itself for fluent interface

allOffAnimationEnd

  • allOffAnimationEnd(): this
  • Remove all listeners from Animation End Event

    Returns this

    Object itself for fluent interface

allOffEveryAnimationEnd

  • allOffEveryAnimationEnd(): this
  • Remove all listeners from Every Animation End Event

    Returns this

    Object itself for fluent interface

finish

  • finish(emitEvents: boolean): Animation | undefined
  • Finish current animation and start the next one on the sequence

    Parameters

    • emitEvents: boolean

      Flag that tells whether the function should emit any events

    Returns Animation | undefined

    Future animations or undefined

finishAll

  • finishAll(emitEvents: boolean): void
  • Finish all animations

    Parameters

    • emitEvents: boolean

      Flag that tells whether the function should emit any events

    Returns void

getFinalValues

  • getFinalValues(): number[]
  • Get final value of queued animations

    Returns number[]

    Final values of the animations

getTimeUntilFinish

  • getTimeUntilFinish(): number
  • Get time until all queued animations will finish

    Returns number

isOver

  • isOver(): boolean
  • Get is animation over and there are no queued animations

    Returns boolean

offAllAnimationEnd

  • offAllAnimationEnd(token: Token): boolean
  • Remove a listener from All Animation End Event

    Parameters

    • token: Token

      Token of the listener

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offAnimationEnd

  • offAnimationEnd(token: Token): boolean
  • Remove a listener from Animation End Event

    Parameters

    • token: Token

      Token of the listener

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offEveryAnimationEnd

  • offEveryAnimationEnd(token: Token): boolean
  • Remove a listener from Every Animation End Event

    Parameters

    • token: Token

      Token of the listener

    Returns boolean

    True if the listener is successfully removed and false if it is not found

onAllAnimationEnd

  • onAllAnimationEnd(action: VoidFunction, token?: Token): Token
  • Subscribe on all subsequent animations end event

    Parameters

    • action: VoidFunction

      Event listener

    • token: Token

    Returns Token

    Token of the event listener

onAnimationEnd

  • onAnimationEnd(action: function, token?: Token): Token
  • Subscribe on current animation end event

    Parameters

    • action: function

      Event listener

        • Parameters

          Returns void

    • token: Token

    Returns Token

    Token of the event listener

onEveryAnimationEnd

  • onEveryAnimationEnd(action: function, token?: Token): Token
  • Subscribe on every subsequent animations end event

    Parameters

    • action: function

      Event listener

        • Parameters

          Returns void

    • token: Token

    Returns Token

    Token of the event listener

start

  • start(): this
  • Starts an animation

    Returns this

    Object itself for fluent interface