-
Notifications
You must be signed in to change notification settings - Fork 22
Home
Raiix edited this page Aug 8, 2021
·
2 revisions
- Add a
SpineSprite
node to your scene. - Create a
SpineAnimationStateDataResouce
inAnimation State Data Res
property of theSpineSprite
. - Create a
SpineSkeletonDataResource
inSkeleton
property of theSpineAnimationStateDataResource
you just create. - Drag the
.atlas
file into theAtlas Res
property and the.json
file into theSkeleton Json Res
property of theSpineSkeletonDataResouce
you just create. Make sure the.atlas
file,.json
file and the image files exported from Spine Editor are in the same directory. - After loading in seconds, you should see the Spine animation shows up in the scene.
- Set the value of the
Track Count
property of theSpineSprite
to1
. - Choose the animation you want to play in the
Animation
property in theId 0
group of theSpineSprite
. - Now you should see the
SpineSprite
is playing the animation you just choose.
- Select the
SpineSprite
in the scene tree. - Click the
Animate
button in the tool bar. - Choose a
AnimationPlayer
to override or nothing to create a new one. - Modify the settings in the dialog to meet your need.
- Click
Generate/Override
and you will see anAnimationPlayer
node is created/ovrrided with the Spine animations.
- Create a node as a child of the
SpineSprite
. - Create an array with 1 element that is an array with 2 element in the
Bind Slot Nodes
property of theSpineSprite
. - The first element of the second array is the slot name you want the node to bind with that is a
String
type. - The second element of the second array is the node path of which you just create.
- Assign the node path of the node.
- Now you should see the node's transform is synchronizing with the slot.
- Create a
PackedSpineSkinResouce
in thePacked Skin Resouce
property of theSpineSprite
. - Set a unique name to the
Skin Name
property of thePackedSpineSkinResource
. - Create an array with the skin names in the
Sub Skin Names
property of thePackedSpineSkinResouce
. - Now you should see the skin you set shows up.
- Make sure you have loaded the Spine animation resources in the
SpineSprite
. - Call the
get_skeleton()
method of theSpineSprite
to get the runtime skeleton. - Call the
find_bone(bone_name)
method of theSpineSkeleton
to get the bone. - Call the
get_godot_global_transform()
method of theSpineBone
to get the global transform of the bone. - Call the
set_godot_global_transform(global_transform)
method of theSpineBone
to set the global transform of the bone.
- Add a
SpineCollisionShapeProxy
to your scene. - Assign the node path of the
SpineSprite
to theSpine Sprite Path
property of theSpineCollisionShapeProxy
. - Choose the slot to which the bouding box is attached.
- Now the
SpineCollisionShapeProxy
has the shape exactly the same as the bouding box you choose.