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 eventString The name of the event.
-
frameToTime(frame){number}
-
get time
Name Type Description framenumber frame index
Returns:
Type Description number -
getLayerByName(name){object}
-
get layer by name path
Name Type Description namestring layer name path, example: root.gift.star1
Returns:
Type Description object -
off(event, fn, context, once)
-
proxy this.group event-off
Name Type Description eventString The event we want to remove.
fnfunction The listener that we need to find.
contextMixed Only remove listeners matching this context.
onceBoolean 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 eventString Name of the event.
fnfunction Callback function.
contextMixed 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 eventString Name of the event.
fnfunction Callback function.
contextMixed 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 eventString The event we want to remove.
fnfunction The listener that we need to find.
contextMixed Only remove listeners matching this context.
onceBoolean 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 speednumber