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

ConditionAnimation

MikhailTymchukDX edited this page Apr 12, 2017 · 2 revisions

ConditionAnimation (inherits SelectionAnimation)

The ConditionAnimation is used as a control structure to play a specific child animation depending on the result of executing the conditionScript. If the conditionScript evaluates to true, the first child animation is played. If it evaluates to false, the second child animation is played (although nothing is played if a second animation is not present).

Client properties

Name Description
conditionScript JavaScript that should evaluate to true or false to determine which child animation to play.

Client methods

Name Description
constructor(target, duration, fps, animations, conditionScript)
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.

Client properties

conditionScript

JavaScript that should evaluate to true or false to determine which child animation to play.

Getter name: get_conditionScript()
Setter name: set_conditionScript(value)

Client methods

constructor(target, duration, fps, animations, conditionScript)

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.
  • conditionScript

    • Type: Object
    • Description: JavaScript that should evaluate to true or false to determine which child animation to play.

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.

Clone this wiki locally