Vertices


A set of vertex data used by Canvas.drawVertices.

Summary

Public constructors

Vertices(
    vertexMode: VertexMode,
    positions: FloatArray,
    textureCoordinates: FloatArray,
    colors: IntArray,
    indices: ShortArray
)

Creates a Vertices instance from the arrays.

Cmn
Vertices(
    vertexMode: VertexMode,
    positions: List<Offset>,
    textureCoordinates: List<Offset>,
    colors: List<Color>,
    indices: List<Int>
)
Cmn

Public constructors

Vertices

Vertices(
    vertexMode: VertexMode,
    positions: FloatArray,
    textureCoordinates: FloatArray,
    colors: IntArray,
    indices: ShortArray
)

Creates a Vertices instance from the arrays. For performance reasons, this constructor does not make defensive copies of the provided arrays, instead uses them directly. The Vertices instance takes full ownership of the provided raw data. The caller must not mutate these arrays after this instance is created, as modifying the data may lead to unpredictable rendering behavior.

Parameters
vertexMode: VertexMode

The VertexMode used to draw the vertices.

positions: FloatArray

A FloatArray of x, y pairs representing vertex positions.

textureCoordinates: FloatArray

A FloatArray of u, v pairs representing texture coordinates.

colors: IntArray

An IntArray of ARGB colors for each vertex.

indices: ShortArray

A ShortArray of indices into the positions (texture, color) array.

Vertices

Vertices(
    vertexMode: VertexMode,
    positions: List<Offset>,
    textureCoordinates: List<Offset>,
    colors: List<Color>,
    indices: List<Int>
)

Public properties

colors

val colorsIntArray

indices

val indicesShortArray

positions

val positionsFloatArray

textureCoordinates

val textureCoordinatesFloatArray

vertexMode

val vertexModeVertexMode