CGSGTimeline Class
Item Index
Methods
Methods
_computeNumberOfFrameBetweenKeys
()
private
Compute the number of steps between all keys, 2 by 2
addKey
-
frame.
-
value
Add a new animation key frame to the timeline and sort the timeline by frame number
compute
()
public
Compute all the values (steps) for the animation of this timeline
getNbKeys
()
Number
public
Returns:
the number of keys in this timeline. Must be an integer value.
getValue
-
frame
Get the value for the frame number passed in parameter
Parameters:
-
frame
Numberthe frame bound with the returned value. Must be an integer value.
Returns:
Object with 2 properties : frame and value, or undefined If no key is defined, return undefined If there is only one key, returns it's value If the frame is before the first key, returns the first key value If the frame is after the last key, returns the last key value
importValues
-
newValues
-
startFrame
Import new precomputed values for this timeline. The number of values must match the number of frame defined by the keys of this timeline
removeAll
()
public
Remove all keys and values
removeKey
-
frame
Remove the key at the specified frame
Parameters:
-
frame
NumberMust be an integer value.
sortByFrame
()
public
Sort the list of keys by frame number
Properties
attribute
String
A string representing the attribute to be animated (eg: "position.x", "rotation.angle", "color.g", ...) The attribute must be a numeric property
listValues
Array
list of the [frame, value] pairs for the animation the index of the list begins at 0, not at the first key frame