Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

SelectionAnimation

MikhailTymchukDX edited this page Apr 12, 2017 · 2 revisions

SelectionAnimation (inherits ParentAnimation)

The SelectionAnimation will run a single animation chosen from of its child animations. It is important to note that the SelectionAnimation ignores the duration and fps properties, and will let each of its child animations use any settings they please. This is a base class with no functional implementation, so consider using ConditionAnimation or CaseAnimation instead.

Client methods

Name Description
constructor(target, duration, fps, animations)
getSelectedIndex() Get the index of the animation that is selected to be played. If this returns an index outside the bounds of the child animations array, then nothing is played.
onEnd() The onEnd method is called just after the animation is played each time.
onStart() The onStart method is called just before the animation is played each time.
onStep(percentage) The onStep method is called repeatedly to progress the animation through each frame.

Client methods

constructor(target, duration, fps, animations)

Params:

  • target

    • Type: Object
    • Description: Target of the animation.
  • duration

    • Type: Number
    • Description: Length of the animation in seconds. The default is 1.
  • fps

    • Type: Number
    • Description: Number of steps per second. The default is 25.
  • animations

    • Type: Object
    • Description: Array of child animations to be played.

getSelectedIndex()

Get the index of the animation that is selected to be played. If this returns an index outside the bounds of the child animations array, then nothing is played.

onEnd()

The onEnd method is called just after the animation is played each time.

onStart()

The onStart method is called just before the animation is played each time.

onStep(percentage)

The onStep method is called repeatedly to progress the animation through each frame.

Params:

  • percentage
    • Type: Number
    • Description: Percentage of the animation already complete.
Clone this wiki locally