drawTriangles

fun drawTriangles(positions: Array<Point>, colors: IntArray? = null, texCoords: Array<Point>? = null, indices: ShortArray? = null, blendMode: BlendMode, paint: Paint): Canvas

Draws a triangle mesh, using clip and Matrix.

If paint contains an Shader and vertices does not contain texCoords, the shader is mapped using the vertices' positions.

If vertices colors are defined in vertices, and Paint paint contains Shader, BlendMode mode combines vertices colors with Shader.

Parameters

positions

triangle mesh to draw

colors

color array, one for each corner; may be null

texCoords

Point array of texture coordinates, mapping Shader to corners; may be null

indices

with which indices points should be drawn; may be null

blendMode

combines vertices colors with Shader, if both are present

paint

specifies the Shader, used as Vertices texture

See also