MeshAttachment

AttachmentVertexAttachmentspine.attachments.MeshAttachment (Class)

An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.

See Mesh attachments in the Spine User Guide.

Instance Members

Name Type
region spine.support.graphics.TextureRegion

Returns
spine.support.graphics.TextureRegion

spine
updateUVs(): Void

Calculates {@link #uvs} using {@link #regionUVs} and the {@link #region}. Must be called after changing the region UVs or region.


spine
getTriangles(): spine.support.utils.ShortArray

Triplets of vertex indices which describe the mesh's triangulation.

Returns
spine.support.utils.ShortArray

spine
setTriangles(triangles: spine.support.utils.ShortArray): Void
Name Type
triangles spine.support.utils.ShortArray

spine
getRegionUVs(): spine.support.utils.FloatArray

The UV pair for each vertex, normalized within the texture region.

Returns
spine.support.utils.FloatArray

spine
setRegionUVs(regionUVs: spine.support.utils.FloatArray): Void

Sets the texture coordinates for the region. The values are u,v pairs for each vertex.

Name Type
regionUVs spine.support.utils.FloatArray

The UV pair for each vertex, normalized within the entire texture.

See {@link #updateUVs}. | Returns | |---------| | [spine.support.utils.FloatArray](/api-docs/clay-native/spine/support/utils/FloatArray/) |


Name Type
uvs spine.support.utils.FloatArray

The color to tint the mesh.

Returns
spine.support.graphics.Color

spine
getPath(): String

The name of the texture region for this attachment.

Returns
String

spine
setPath(path: String): Void
Name Type
path String

spine
getHullLength(): Int

The number of entries at the beginning of {@link #vertices} that make up the mesh hull.

Returns
Int

spine
setHullLength(hullLength: Int): Void
Name Type
hullLength Int

spine
setEdges(edges: spine.support.utils.ShortArray): Void
Name Type
edges spine.support.utils.ShortArray

Vertex index pairs describing edges for controlling triangulation, or be null if nonessential data was not exported. Mesh triangles will never cross edges. Triangulation is not performed at runtime.

Returns
spine.support.utils.ShortArray

spine
getWidth(): Float

The width of the mesh's image, or zero if nonessential data was not exported.

Returns
Float

spine
setWidth(width: Float): Void
Name Type
width Float

spine
getHeight(): Float

The height of the mesh's image, or zero if nonessential data was not exported.

Returns
Float

spine
setHeight(height: Float): Void
Name Type
height Float

spine
getParentMesh(): MeshAttachment

The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices}, {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture).

Returns
MeshAttachment

spine
setParentMesh(parentMesh: MeshAttachment): Void
Name Type
parentMesh MeshAttachment

spine
copy(): Attachment
Returns
Attachment

spine
newLinkedMesh(): MeshAttachment

Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh.

Returns
MeshAttachment

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

Private Members


spine
path: String





spine
hullLength: Int

spine
parentMesh: MeshAttachment


spine
width: Float

spine
height: Float