Home - MikhailTymchukDX/AppVeyorTest GitHub Wiki

Animation

Animation is an abstract base class used as a starting point for all the other animations. It provides the basic mechanics for the animation (playing, pausing, stopping, timing, etc.) and leaves the actual animation to be done in the abstract methods getAnimatedValue and setValue.

Client properties

Name Description
duration Length of the animation in seconds. The default is 1.
fps Number of steps per second. The default is 25.
isActive true if animation is active, false if not.
isPlaying true if animation is playing, false if not.
percentComplete Percentage of the animation already played.
target Target Sys.UI.DomElement of the animation.

Client methods

Name Description
getAnimatedValue(percentage) Determine the state of the animation after the given percentage of its duration has elapsed.
interpolate(start, end, percentage) The interpolate function is used to find the appropriate value between starting and ending values given the current percentage.
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.
pause() Pause the animation if it is playing. Calling play will resume where the animation left off.
play() Play the animation from the beginning or where it was left off when paused.
setOwner(owner) Makes this animation the child of another animation.
setValue(value) Set the current state of the animation.
stop() Stop playing the animation.

Client events

Name Description
ended Fires just after the animation is played each time.
started Fires just before the animation is played each time.
step Fires at each frame of the the animation.

Client properties

duration

Length of the animation in seconds. The default is 1.

Getter name: get_duration()Setter name: set_duration(value)

fps

Number of steps per second. The default is 25.

Getter name: get_fps()Setter name: set_fps(value)

target

Target Sys.UI.DomElement of the animation.

Getter name: get_target()Setter name: set_target(value)

percentComplete

Percentage of the animation already played.

Getter name: get_percentComplete()Setter name: set_percentComplete(value)

isActive

true if animation is active, false if not.

Getter name: get_isActive()

isPlaying

true if animation is playing, false if not.

Getter name: get_isPlaying()

Client methods

play()

Play the animation from the beginning or where it was left off when paused.

pause()

Pause the animation if it is playing. Calling play will resume where the animation left off.

stop()

Stop playing the animation.

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.

onEnd()

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

getAnimatedValue(percentage)

Determine the state of the animation after the given percentage of its duration has elapsed.

Params:

  • percentage
    • Type: Number
    • Description: Percentage of the animation already complete.

setValue(value)

Set the current state of the animation.

Params:

  • value
    • Type: Object
    • Description: Animation state.

interpolate(start, end, percentage)

The interpolate function is used to find the appropriate value between starting and ending values given the current percentage.

Params:

  • start

    • Type: Number
    • Description: Start of the range to interpolate.
  • end

    • Type: Number
    • Description: End of the range to interpolate.
  • percentage

    • Type: Number
    • Description: Percentage completed in the range to interpolate.

setOwner(owner)

Makes this animation the child of another animation.

Params:

  • owner
    • Type: Object
    • Description: Parent animation.

Client events

started

Fires just before the animation is played each time.

Add event handler method: add_started(handler)Remove event handler method: remove_started(handler)Raise event method: raise_started()

ended

Fires just after the animation is played each time.

Add event handler method: add_ended(handler)Remove event handler method: remove_ended(handler)Raise event method: raise_ended()

step

Fires at each frame of the the animation.

Add event handler method: add_step(handler)Remove event handler method: remove_step(handler)Raise event method: raise_step()

ParentAnimation (inherits Animation)

The ParentAnimation serves as a base class for all animations that contain children (such as Sys.Extended.UI.Animation.ParallelAnimation, Sys.Extended.UI.SequenceAnimation, etc.). It does not actually play the animations, so any classes that inherit from it must do so. Any animation that requires nested child animations must inherit from this class, although it will likely want to inherit off of Sys.Extended.UI.Animation.ParallelAnimation or Sys.Extended.UI.SequenceAnimation which will actually play their child animations.

Client properties

Name Description
animations Array of child animations to be played (there are no assumptions placed on order because it will matter for some derived animations like Sys.Extended.UI.Animation.SequenceAnimation, but not for others like Sys.Extended.UI.Animation.ParallelAnimation). To manipulate the child animations, use the functions add, clear, remove, and removeAt.

Client methods

Name Description
add(animation) Add an animation as a child of this animation.
clear() Clear the array of child animations. This will dispose the cleared child animations.
remove(animation) Remove the animation from the array of child animations. This will dispose the removed animation.
removeAt(index) Remove the animation at a given index from the array of child animations.

Client properties

animations

Array of child animations to be played (there are no assumptions placed on order because it will matter for some derived animations like Sys.Extended.UI.Animation.SequenceAnimation, but not for others like Sys.Extended.UI.Animation.ParallelAnimation). To manipulate the child animations, use the functions add, clear, remove, and removeAt.

Getter name: get_target()

Client methods

add(animation)

Add an animation as a child of this animation.

Params:

  • animation
    • Type: Object
    • Description: Child animation to add.

remove(animation)

Remove the animation from the array of child animations. This will dispose the removed animation.

Params:

  • animation
    • Type: Object
    • Description: Child animation to remove.

removeAt(index)

Remove the animation at a given index from the array of child animations.

Params:

  • index
    • Type: Number
    • Description: Index of the child animation to remove.

clear()

Clear the array of child animations. This will dispose the cleared child animations.