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.

Constructor

new(data:SlotData, bone:Bone)

Variables

@:value(new Color())color:Color = new Color()

darkColor:Color

@:value(0)attachmentState:Int = 0

Methods

getData():SlotData

The slot's setup pose data.

getBone():Bone

The bone this slot belongs to.

getSkeleton():Skeleton

The skeleton this slot belongs to.

getColor():Color

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.

getDarkColor():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.

getAttachment():Attachment

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

setAttachment(attachment: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.

getAttachmentTime():Float

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

getDeform():FloatArray

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}.

setToSetupPose():Void

Sets this slot to the setup pose.