Stores the current pose for a skeleton.

See Instance objects in the Spine Runtimes Guide.

Constructor

Variables

finalbones:Array<Bone>

The skeleton's bones, sorted parent first. The root bone is always the first bone.

color:Color

The color to tint all the skeleton's attachments.

finaldata:SkeletonData

The skeleton's setup pose data.

finaldrawOrder:Array<Slot>

The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order.

finalikConstraints:Array<IkConstraint>

The skeleton's IK constraints.

finalpathConstraints:Array<PathConstraint>

The skeleton's path constraints.

@:value(1.0)scaleX:Float = 1.0

Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale inheritance.

@:value(1.0)scaleY:Float = 1.0

Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale inheritance.

skin:Null<Skin>

The skeleton's current skin.

finalslots:Array<Slot>

The skeleton's slots.

@:value(0.0)time:Float = 0.0

Returns the skeleton's time. This can be used for tracking, such as with Slot Slot.getAttachmentTime.

See also:

  • update.

finaltransformConstraints:Array<TransformConstraint>

The skeleton's transform constraints.

@:value(0.0)x:Float = 0.0

Sets the skeleton X position, which is added to the root bone worldX position.

@:value(0.0)y:Float = 0.0

Sets the skeleton Y position, which is added to the root bone worldY position.

Methods

findBone(boneName:String):Null<Bone>

findBoneIndex(boneName:String):Int

Returns:

-1 if the bone was not found.

findIkConstraint(constraintName:String):Null<IkConstraint>

Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method than to call it repeatedly.

findPathConstraint(constraintName:String):Null<PathConstraint>

Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method than to call it repeatedly.

findSlot(slotName:String):Null<Slot>

Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it repeatedly.

findSlotIndex(slotName:String):Int

Returns:

-1 if the bone was not found.

findTransformConstraint(constraintName:String):Null<TransformConstraint>

Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of this method than to call it repeatedly.

getAttachment(slotIndex:Int, attachmentName:String):Null<Attachment>

Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.

See Runtime skins in the Spine Runtimes Guide.

getAttachmentByName(slotName:String, attachmentName:String):Null<Attachment>

Finds an attachment by looking in the skin and SkeletonData.defaultSkin using the slot name and attachment name.

See also:

  • getAttachment.

getBounds(offset:Vector2, size:Vector2, ?temp:Array<Float>):Void

Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.

Parameters:

offset

An output value, the distance from the skeleton origin to the bottom left corner of the AABB.

size

An output value, the width and height of the AABB.

temp

Working memory to temporarily store attachments' computed world vertices.

setAttachment(slotName:String, attachmentName:Null<String>):Void

A convenience method to set an attachment by finding the slot with findSlot, finding the attachment with getAttachment, then setting the slot's Slot.setAttachment.

Parameters:

attachmentName

May be null to clear the slot's attachment.

setBonesToSetupPose():Void

Sets the bones and constraints to their setup pose values.

setSkin(newSkin:Null<Skin>):Void

Sets the skin used to look up attachments before looking in the {@link SkeletonData#defaultSkin default skin}. If the skin is changed, {@link #updateCache()} is called.

Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no old skin, each slot's setup mode attachment is attached from the new skin.

After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply()} is called before the next time the skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.

setSkinByName(skinName:String):Void

Sets a skin by name.

See also:

  • setSkin.

setSlotsToSetupPose():Void

Sets the slots and draw order to their setup pose values.

setToSetupPose():Void

Sets the bones, constraints, and slots to their setup pose values.

sortBone(bone:Bone):Void

sortPathConstraintAttachment(skin:Skin, slotIndex:Int, slotBone:Bone):Void

sortReset(bones:Array<Bone>):Void

update(delta:Float):Void

Increments the skeleton's time.

updateCache():Void

Caches information about bones and constraints. Must be called if the skin is modified or if bones, constraints, or weighted path attachments are added or removed.

updateWorldTransform():Void

Updates the world transform for each bone and applies all constraints.

See World transforms in the Spine Runtimes Guide.