spine

Version: stable

FUNCTION
play_anim()
cancel()
get_go()
set_skin()
set_attachment()
reset_constant()

Functions

play_anim()

play_anim(url,anim_id,playback,options,callback_function)

Plays the specified animation on a Spine model. A [ref:spine_animation_done] message is sent to the callback (or message handler). Any spine events will also be handled in the same way. [icon:attention] The callback is not called (or message sent) if the animation is cancelled with [ref:spine.cancel]. The callback is called (or message sent) only for animations that play with the following playback modes * `go.PLAYBACK_ONCE_FORWARD` * `go.PLAYBACK_ONCE_BACKWARD` * `go.PLAYBACK_ONCE_PINGPONG`

PARAMETERS

url string, hash, url The Spine model for which to play an animation
anim_id hash Id of the animation to play
playback number Playback mode of the animation (from go.PLAYBACK_*)
options table Playback options
blend_duration number Duration of a linear blend between the current and new animation.
offset number The normalized initial value of the animation cursor when the animation starts playing.
playback_rate constant The rate with which the animation will be played. Must be positive.
track number The track index of the animation. Defaults to 1. Animations on different tracks play in parallel.
callback_function function function to call when the animation has completed or a Spine event occured
self object The context of the calling script
message_id hash The name of the message ("spine_animation_done" or "spine_event")
message table A table that contains the response
animation_id hash The animation that was completed
track number The track index of the animation
playback constant (spine_animation_done only!) The playback mode for the animation
event_id hash (spine_event only!) the event that was triggered.
t float (spine_event only!) the time at which the event occurred (seconds)
integer int (spine_event only!) a custom integer associated with the event (0 by default).
float float (spine_event only!) a custom float associated with the event (0 by default)
string hash (spine_event only!) a custom string associated with the event (hash("") by default)
sender url The invoker of the callback - the Spine model component

cancel()

cancel(url,options)

Cancels all running animations on a specified spine model component

PARAMETERS

url string, hash, url The Spine model for which to cancel the animation
options table Cancel options
track number The index of the track which to cancel the animation on. Defaults to all animations on all tracks.

get_go()

get_go(url,bone_id)

Returns the id of the game object that corresponds to a specified skeleton bone.

PARAMETERS

url string, hash, url The Spine model to query
bone_id hash Id of the corresponding bone

set_skin()

set_skin(url,skin)

Returns the id of the game object that corresponds to a specified skeleton bone.

PARAMETERS

url string, hash, url The Spine model to query
skin string, hash Id of the corresponding skin

set_attachment()

set_attachment(url,slot,attachment)

Set the attachment of a lot on a spine model.

PARAMETERS

url string, hash, url The Spine model to query
slot string, hash Id of the slot
attachment string, hash Id of the attachment

reset_constant()

reset_constant(url,constant)

Resets a shader constant for a spine model component. (Previously set with `go.set()`)

PARAMETERS

url string, hash, url The Spine model to query
constant string, hash name of the constant