Skeleton
spine.Skeleton (Class)
Stores the current pose for a skeleton.
See Instance objects in the Spine
Runtimes Guide.
Instance Members
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.
Updates the world transform for each bone and applies all constraints.
See World transforms in the Spine
Runtimes Guide.
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.
spine
setToSetupPose(): Void
Sets the bones, constraints, slots, and draw order to their setup pose values.
spine
setBonesToSetupPose(): Void
Sets the bones and constraints to their setup pose values.
spine
setSlotsToSetupPose(): Void
Sets the slots and draw order to their setup pose values.
The skeleton's setup pose data.
The skeleton's bones, sorted parent first. The root bone is always the first bone.
The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}.
Returns the root bone, or null if the skeleton has no bones.
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.
The skeleton's slots.
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.
The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order.
The skeleton's current skin.
Sets a skin by name.
See {@link #setSkin(Skin)}.
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.
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)}.
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.
Name |
Type |
slotIndex |
Int |
attachmentName |
String |
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}.
Name |
Type |
Description |
slotName |
String |
|
attachmentName |
String |
May be null to clear the slot's attachment. |
The skeleton's IK constraints.
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.
Name |
Type |
constraintName |
String |
The skeleton's transform constraints.
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.
Name |
Type |
constraintName |
String |
The skeleton's path constraints.
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.
Name |
Type |
constraintName |
String |
Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.
The color to tint all the skeleton's attachments.
A convenience method for setting the skeleton color. The color can also be set by modifying {@link #getColor()}.
A convenience method for setting the skeleton color. The color can also be set by modifying {@link #getColor()}.
Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale
inheritance.
Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale
inheritance.
Sets the skeleton X position, which is added to the root bone worldX position.
Sets the skeleton Y position, which is added to the root bone worldY position.
Sets the skeleton X and Y position, which is added to the root bone worldX and worldY position.
Returns the skeleton's time. This can be used for tracking, such as with Slot {@link Slot#getAttachmentTime()}.
See {@link #update(float)}.
| Returns |
|---------|
| [Float](/api-docs/clay-native/Float/) |
Increments the skeleton's {@link #time}.
Private Members
spine
sortPathConstraintAttachmentWithSkin(skin: Skin, slotIndex: Int, slotBone: Bone): Void