Slot

spine.Slot (Class)

Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared across multiple skeletons.

Instance Members

spine
data: SlotData

spine
bone: Bone




spine
attachmentState: Int

spine
getData(): SlotData

The slot's setup pose data.

Returns
SlotData

spine
getBone(): Bone

The bone this slot belongs to.

Returns
Bone

spine
getSkeleton(): Skeleton

The skeleton this slot belongs to.

Returns
Skeleton

The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two color tinting.

Returns
spine.support.graphics.Color

spine
getDarkColor(): spine.support.graphics.Color

The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark color's alpha is not used.

Returns
spine.support.graphics.Color

spine
getAttachment(): spine.attachments.Attachment

The current attachment for the slot, or null if the slot has no attachment.

Returns
spine.attachments.Attachment

spine
setAttachment(attachment: spine.attachments.Attachment): Void

Sets the slot's attachment and, if the attachment changed, resets {@link #attachmentTime} and clears the {@link #deform}. The deform is not cleared if the old attachment has the same {@link VertexAttachment#getDeformAttachment()} as the specified attachment.

Name Type
attachment spine.attachments.Attachment

spine
getAttachmentTime(): Float

The time that has elapsed since the last time the attachment was set or cleared. Relies on Skeleton {@link Skeleton#time}.

Returns
Float

spine
setAttachmentTime(time: Float): Void
Name Type
time Float

Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.

See {@link VertexAttachment#computeWorldVertices(Slot, int, int, float[], int, int)} and {@link DeformTimeline}. | Returns | |---------| | [spine.support.utils.FloatArray](/api-docs/clay-native/spine/support/utils/FloatArray/) |


spine
setDeform(deform: spine.support.utils.FloatArray): Void
Name Type
deform spine.support.utils.FloatArray

spine
setToSetupPose(): Void

Sets this slot to the setup pose.


spine
toString(): String
Returns
String

spine
new(data: SlotData, bone: Bone): Void
Name Type
data SlotData
bone Bone

Private Members

spine
attachmentTime: Float