new AnimationGroup(options)
pass a data and extra config
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
config and keyframes
|
Methods
-
bindSlot(name, slot)
-
bind other animation group to this animation group with name path
Name Type Description name
* slot
* -
emit(event)
-
proxy this.group event-emit
Emit an event to all registered event listeners.Name Type Description event
String The name of the event.
-
frameToTime(frame){number}
-
get time
Name Type Description frame
number frame index
Returns:
Type Description number -
getLayerByName(name){object}
-
get layer by name path
Name Type Description name
string layer name path, example: root.gift.star1
Returns:
Type Description object -
off(event, fn, context, once)
-
proxy this.group event-off
Name Type Description event
String The event we want to remove.
fn
function The listener that we need to find.
context
Mixed Only remove listeners matching this context.
once
Boolean Only remove once listeners.
-
on(event, fn, context)
-
proxy this.group event-on
Register a new EventListener for the given event.Name Type Default Description event
String Name of the event.
fn
function Callback function.
context
Mixed this optional The context of the function.
-
once(event, fn, context)
-
proxy this.group event-once
Add an EventListener that's only called once.Name Type Default Description event
String Name of the event.
fn
function Callback function.
context
Mixed this optional The context of the function.
-
pause(){this}
-
pause this animation group
Returns:
Type Description this -
play(){this}
-
play this animation group
Returns:
Type Description this -
removeAllListeners(event, fn, context, once)
-
proxy this.group event-removeAllListeners
Remove event listeners.Name Type Description event
String The event we want to remove.
fn
function The listener that we need to find.
context
Mixed Only remove listeners matching this context.
once
Boolean Only remove once listeners.
-
replay(){this}
-
replay this animation group
Returns:
Type Description this -
resume(){this}
-
resume or play this animation group
Returns:
Type Description this -
setSpeed(speed)
-
set animation speed, time scale
Name Type Description speed
number