Shape

class Shape(color: Long)

Functions

Link copied to clipboard
fun addVertex(x: Float, y: Float): Shape
Link copied to clipboard
fun clone(): Shape
Link copied to clipboard
fun copy(): Shape
Link copied to clipboard
fun draw(): Shape
Link copied to clipboard
fun getColor(): Long
Link copied to clipboard
fun getDrawMode(): Int
Link copied to clipboard
fun getVertexes(): List<Vector2f>
Link copied to clipboard
fun insertVertex(index: Int, x: Float, y: Float): Shape
Link copied to clipboard
fun removeVertex(index: Int): Shape
Link copied to clipboard
fun setCircle(x: Float, y: Float, radius: Float, steps: Int): Shape

Sets the shape as a circle with a center at x, y with radius and number of steps around the circle

Link copied to clipboard
fun setColor(color: Long): Shape
Link copied to clipboard
fun setDrawMode(drawMode: Int): Shape

Sets the GL draw mode of the shape. Possible draw modes are: 0 = points 1 = lines 2 = line loop 3 = line strip 5 = triangles 5 = triangle strip 6 = triangle fan 7 = quads 8 = quad strip 9 = polygon

Link copied to clipboard
fun setLine(x1: Float, y1: Float, x2: Float, y2: Float, thickness: Float): Shape

Sets the shape as a line pointing from x1, y1 to x2, y2 with a thickness

Sources

Link copied to clipboard