library / com.otaliastudios.opengl.draw / GlPolygon

GlPolygon

open class GlPolygon : Gl2dDrawable

Constructors

<init>

GlPolygon(sides: Int)

Properties

center

var center: PointF

centerX

var centerX: Float

centerY

var centerY: Float

radius

var radius: Float

The polygon radius. The value 1 is half the smallest viewport dimension. For example, a GlCircle with radius 1 will touch the viewport borders exactly.

rotation

var rotation: Float

vertexArray

open var vertexArray: FloatBuffer

Returns the array of vertices. To avoid allocations, this returns internal state. The caller must not modify it.

Inherited Properties

coordsPerVertex

val coordsPerVertex: Int

Returns the number of position coordinates per vertex. This will be 2 or 3.

Functions

draw

open fun draw(): Unit

Draws this drawable. This function should not be called directly. Instead, this drawable should be passed to some GlProgram.

onViewportSizeChanged

open fun onViewportSizeChanged(): Unit

Inherited Functions

getBounds

fun getBounds(rect: RectF): Unit

Inheritors

GlCircle

open class GlCircle : GlPolygon

GlSquare

open class GlSquare : GlPolygon

GlTriangle

open class GlTriangle : GlPolygon