VertexAttachment

Attachmentspine.attachments.VertexAttachment (Class) → BoundingBoxAttachment, ClippingAttachment, MeshAttachment, PathAttachment

Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's {@link Slot#getDeform()}.

Instance Members



spine
worldVerticesLength: Int

spine
deformAttachment: VertexAttachment

spine
computeWorldVertices(slot: spine.Slot, start: Int, count: Int, worldVertices: spine.support.utils.FloatArray, offset: Int, stride: Int): Void

Transforms the attachment's local {@link #getVertices()} to world coordinates. If the slot's {@link Slot#getDeform()} is not empty, it is used to deform the vertices.

See World transforms in the Spine Runtimes Guide.

Name Type Description
slot spine.Slot
start Int The index of the first {
count Int The number of world vertex values to output. Must be <= {
worldVertices spine.support.utils.FloatArray The output world vertices. Must have a length >= offset + count * stride / 2.
offset Int The worldVertices index to begin writing values.
stride Int The number of worldVertices entries between the value pairs written.

spine
getDeformAttachment(): VertexAttachment

Deform keys for the deform attachment are also applied to this attachment.

Returns Description
VertexAttachment May be null if no deform keys should be applied.

spine
setDeformAttachment(deformAttachment: VertexAttachment): Void
Name Type Description
deformAttachment VertexAttachment May be null if no deform keys should be applied.

The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#getBones()}. Will be null if this attachment has no weights.

Returns
spine.support.utils.IntArray

spine
setBones(bones: spine.support.utils.IntArray): Void
Name Type Description
bones spine.support.utils.IntArray May be null if this attachment has no weights.

The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are x,y entries for each vertex. For a weighted attachment, the values are x,y,weight entries for each bone affecting each vertex.

Returns
spine.support.utils.FloatArray

spine
setVertices(vertices: spine.support.utils.FloatArray): Void
Name Type
vertices spine.support.utils.FloatArray

spine
getWorldVerticesLength(): Int

The maximum number of world vertex values that can be output by {@link #computeWorldVertices(Slot, int, int, float[], int, int)} using the count parameter.

Returns
Int

spine
setWorldVerticesLength(worldVerticesLength: Int): Void
Name Type
worldVerticesLength Int

spine
getId(): Int

Returns a unique ID for this attachment.

Returns
Int

spine
copyTo(attachment: VertexAttachment): Void

Does not copy id (generated) or name (set on construction).

Name Type
attachment VertexAttachment

spine
new(name: String): Void
Name Type
name String

Private Members

spine
nextID: Int

spine
id: Int

spine
getNextID(): Int
Returns
Int