Polyline

open class Polyline : UIElement

Draws A polyline

Maximum points per polyline is: getMaxPoints

Supported transformations: Scale, Rotate, Translate

Constructors

Link copied to clipboard
constructor()
constructor(id: String)
constructor(_xys: FloatArray)

initialize the polyline with points The number of points must be less then getMaxPoints

constructor(_xys: FloatArray, id: String)

initialize the polyline with points The number of points must be less then getMaxPoints

Functions

Link copied to clipboard
fun add(x: Float, y: Float): Polyline

Adds a point to the polyline

Link copied to clipboard
fun addAt(index: Int, x: Float, y: Float): Polyline

Adds a point to the polyline at an index

Link copied to clipboard

Remove all points from the ui elements

Link copied to clipboard

Returns the maximum supported points per polyline (currently 60)

Link copied to clipboard
fun getX(index: Int): Float

Receive the x value of a point at an index

Link copied to clipboard
fun getY(index: Int): Float

Receive the y value of a point at an index

Link copied to clipboard
protected open override fun onDraw(canvas: CanvasBuffer)

The draw method is called to actually draw the ui element visual representation to the CanvasBuffer

Link copied to clipboard
fun removeAt(index: Int): Polyline

Removes a point from the polyline at an index

Link copied to clipboard

Removes the first point from the polyline

Link copied to clipboard

Removes the last point from the polyline

Link copied to clipboard
fun size(): Int

Get the number of points that were added to the polyline