Stores the current pose for a skeleton.

See Instance objects in the Spine Runtimes Guide.

Constructor

Variables

Methods

updateCache():Void

Caches information about bones and constraints. Must be called if the {@link #getSkin()} 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.

updateWorldTransformWithParent(parent:Bone):Void

Temporarily sets the root bone as a child of the specified bone, then updates the world transform for each bone and applies all constraints.

See World transforms in the Spine Runtimes Guide.

setToSetupPose():Void

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

setBonesToSetupPose():Void

Sets the bones and constraints to their setup pose values.

setSlotsToSetupPose():Void

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

getData():SkeletonData

The skeleton's setup pose data.

getBones():Array<Bone>

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

getUpdateCache():Array<Updatable>

The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}.

getRootBone():Bone

Returns the root bone, or null if the skeleton has no bones.

findBone(boneName:String):Bone

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

getSlots():Array<Slot>

The skeleton's slots.

findSlot(slotName:String):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.

getDrawOrder():Array<Slot>

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

getSkin():Skin

The skeleton's current skin.

setSkinByName(skinName:String):Void

Sets a skin by name.

See {@link #setSkin(Skin)}.

setSkin(newSkin:Skin):Void

Sets the skin used to look up attachments before looking in the {@link SkeletonData#getDefaultSkin() 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(Skeleton)} 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.

getAttachmentWithSlotName(slotName:String, attachmentName:String):Attachment

Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment name.

See {@link #getAttachment(int, String)}.

getAttachment(slotIndex:Int, attachmentName:String):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.

setAttachment(slotName:String, attachmentName:String):Void

A convenience method to set an attachment by finding the slot with {@link #findSlot(String)}, finding the attachment with {@link #getAttachment(int, String)}, then setting the slot's {@link Slot#attachment}.

Parameters:

attachmentName

May be null to clear the slot's attachment.

getIkConstraints():Array<IkConstraint>

The skeleton's IK constraints.

findIkConstraint(constraintName:String):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.

getTransformConstraints():Array<TransformConstraint>

The skeleton's transform constraints.

findTransformConstraint(constraintName:String):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.

getPathConstraints():Array<PathConstraint>

The skeleton's path constraints.

findPathConstraint(constraintName:String):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.

getBounds(offset:Vector2, size:Vector2, temp:FloatArray):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.

getColor():Color

The color to tint all the skeleton's attachments.

setColor(color:Color):Void

A convenience method for setting the skeleton color. The color can also be set by modifying {@link #getColor()}.

setColorWithRGBA(r:Float, g:Float, b:Float, a:Float):Void

A convenience method for setting the skeleton color. The color can also be set by modifying {@link #getColor()}.

getScaleX():Float

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

getScaleY():Float

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

setScale(scaleX:Float, scaleY:Float):Void

getX():Float

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

getY():Float

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

setPosition(x:Float, y:Float):Void

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

getTime():Float

Returns the skeleton's time. This can be used for tracking, such as with Slot {@link Slot#getAttachmentTime()}.

See {@link #update(float)}.

update(delta:Float):Void

Increments the skeleton's {@link #time}.