polygon

fun Canvas.polygon(cx: Int, cy: Int, sides: Int, radius: Float, rotation: Float = 0.0f, color: Color = Color.BLACK)

Draws a polygon outline on the canvas.

Parameters

cx

The X coordinate of the polygon center

cy

The Y coordinate of the polygon center

sides

The number of sides of the polygon (minimum 3)

radius

The radius of the polygon

rotation

The rotation of the polygon in degrees

color

The color of the polygon


fun Canvas.polygon(cx: Int, cy: Int, sides: Int, radius: Float, rotation: Float = 0.0f, lineThick: Int, color: Color = Color.BLACK)

Draws a polygon outline on the canvas.

Parameters

cx

The X coordinate of the polygon center

cy

The Y coordinate of the polygon center

sides

The number of sides of the polygon (minimum 3)

radius

The radius of the polygon

rotation

The rotation of the polygon in degrees

lineThick

The thickness of the polygon lines

color

The color of the polygon