LS.Components.PlayAnimation Class
Reads animation tracks from an LS.Animation resource and applies the properties to the objects referenced
Constructor
LS.Components.PlayAnimation
-
object
Parameters:
-
object
Stringto configure from
Item Index
Methods
applyAnimation
-
take
-
time
-
last_time
-
weight
applys the animation to the scene nodes
Parameters:
-
take
Stringthe name of the take
-
time
Numberthe time where to sample the tracks
-
last_time
Number[optional] the last time that was applied, (used to trigger events)
-
weight
Number[optional] the weight of this animation (used for blending animation), if ommited 1 is used
getAnimation
-
name
returns the current animation or an animation with a given name
Parameters:
-
name
String[optional] the name of the animation, if omited then uses the animation set in the component
Returns:
the animation container
getDuration
()
Number
Gets the duration of the current take in the current animation
Returns:
the duration of the take, or -1 if the take was not found or the animation is not loaded
getTake
-
take_name
returns the current animation or an animation with a given name
Parameters:
-
take_name
String[optional] if not specified then it uses the current take
Returns:
the duration of the take, or -1 if the take was not found or the animation is not loaded
pause
()
Pauses the animation
play
()
Resets the time to zero and starts playing the current take of the animation It also triggers a "start_animation" event
playRange
-
start
-
end
Starts playing the animation but only using a range of it
Parameters:
-
start
Numberstart time
-
end
Numberend time
stop
()
Stops the animation and sets the time to zero
Properties
animation
String
the name of the LS.Animation resource where the takes and tracks are stored
mode
Number
how to play the animation, options are: PlayAnimation.LOOP PlayAnimation.PINGPONG PlayAnimation.ONCE PlayAnimation.PAUSED
root_node
String
the root node locator where to apply the animation, is none is specified it is applied using the scene root node if a "@" is set, then only to this node and its children
take
String
the name of the LS.Animation.Take to play from the LS.Animation A take representes a set of tracks