filledPolygon

fun filledPolygon(center: Vec2f, sides: Int, scaleX: Float, scaleY: Float = scaleX, rotation: Angle = 0.radians, innerColor: Float = colorBits, outerColor: Float = colorBits)

Draws a filled polygon.

Parameters

center

the center point

sides

the number of sides

scaleX

the horizontal scale

scaleY

the vertical scale

rotation

the rotation of the polygon

innerColor

the packed color of the center of the polygon. See Color.toFloatBits.

outerColor

the packed color of the perimeter of the polygon. See Color.toFloatBits


fun filledPolygon(x: Float, y: Float, sides: Int, scaleX: Float, scaleY: Float = scaleX, rotation: Angle = 0.radians, innerColor: Float = colorBits, outerColor: Float = colorBits)

Draws a filled polygon.

Parameters

x

the x-coord of the center point

y

the y-coord of the center point

sides

the number of sides

scaleX

the horizontal scale

scaleY

the vertical scale

rotation

the rotation of the polygon

innerColor

the packed color of the center of the polygon. See Color.toFloatBits.

outerColor

the packed color of the perimeter of the polygon. See Color.toFloatBits


fun filledPolygon(vertices: FloatArray, offset: Int = 0, count: Int = vertices.size)

Draws a filled polygon used the specified vertices.

Note: this triangulates the polygon everytime it is called - it is recommended to cache the triangles. Triangulator.computeTriangles can be used to calculate the triangles.

Parameters

vertices

consecutive ordered pairs of the x-y coordinates of the vertices of the polygon

offset

the index of the vertices FloatArray at which to start drawing

count

the number of vertices to draw from the offset


fun filledPolygon(vertices: FloatArray, triangles: ShortArray)

Draws a filled polygon used the specified vertices.

Parameters

vertices

consecutive ordered pairs of the x-y coordinates of the vertices of the polygon

triangles

ordered triples of the indices of the float[] defining the polygon vertices corresponding to triangles. Triangulator.computeTriangles can be used to calculate the triangles.