Functions and constants for interacting with Spine models
Version: stable
spine.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
|
||||||||||||||||||||||||||||||||||||
callback_function |
function |
function to call when the animation has completed or a Spine event occured
|
spine.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
|
spine.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 |
spine.set_skin(url,skin)
Sets the spine skin on a spine model.
PARAMETERS
url |
string hash url |
The Spine model to query |
skin |
string hash |
Id of the corresponding skin |
spine.add_skin(url,skin_a,skin_b)
Adds one spine skin on a spine model to another on the same model.
PARAMETERS
url |
string hash url |
The Spine model to query |
skin_a |
string hash |
Id of the corresponding skin that will recieve the added skin |
skin_b |
string hash |
Id of the corresponding skin to add |
spine.copy_skin(url,skin_a,skin_b)
Copies one spine skin on a spine model to another on the same model.
PARAMETERS
url |
string hash url |
The Spine model to query |
skin_a |
string hash |
Id of the corresponding skin that will recieve the copied skin |
skin_b |
string hash |
Id of the corresponding skin to copy. |
spine.clear_skin(url,skin)
Clear all attachments and constraints from a skin on a spine model
PARAMETERS
url |
string hash url |
The Spine model to query |
skin |
string hash |
Id of the corresponding skin |
spine.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 |
spine.set_slot_color(url,slot,color)
Set the color a slot will tint its attachments on a spine model.
PARAMETERS
url |
string hash url |
The Spine model to query |
slot |
string hash |
Id of the slot |
color |
vector4 |
Tint applied to attachments in a slot |
spine.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 |
spine.reset_ik_target(url,ik_constraint_id)
reset the IK constraint target position to default of a spinemodel.
PARAMETERS
url |
string hash url |
The Spine model |
ik_constraint_id |
string hash |
id of the corresponding IK constraint |
spine.set_ik_target_position(url,ik_constraint_id,position)
set the target position of an IK constraint object.
PARAMETERS
url |
string hash url |
The Spine model |
ik_constraint_id |
string hash |
id of the corresponding IK constraint |
position |
vector3 |
target position |
spine.set_ik_target(url,ik_constraint_id,target_url)
set the IK constraint object target position to follow position.
PARAMETERS
url |
string hash url |
The Spine model to query |
ik_constraint_id |
string hash |
id of the corresponding IK constraint |
target_url |
string hash url |
target game object |
spine.physics_translate(url,translation)
Apply a physics-based translation to the Spine model.
PARAMETERS
url |
string hash url |
The Spine model component to translate. |
translation |
vector3 |
The translation vector to apply to the Spine model. |
spine.physics_rotate(url,center,degrees)
Apply a physics-based rotation to the Spine model.
PARAMETERS
url |
string hash url |
The Spine model component to rotate. |
center |
vector3 |
The center point around which to rotate. |
degrees |
number |
The rotation angle in degrees. |