Path

open class Path : UIElement

Draws A path

Path is a set of line series

Maximum sequential points per path is: getSequentialPathMaxPoints

Path support lineTo and moveTo to create gaps within its drawing

For simple polyline use Polyline

Supported transformations: Scale, Rotate, Translate

Constructors

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

Functions

Link copied to clipboard
fun addPoint(x: Float, y: Float): Path

Adds a point to the path (same as lineTo)

Link copied to clipboard
fun clear(): Path

Remove all points from the ui elements

Link copied to clipboard
fun close(): Path

Closed the last line series to a closed polygon

Link copied to clipboard

Get the number of points were added to the ui element

Link copied to clipboard

Returns the maximum supported points per sequential path (currently 60)

Link copied to clipboard
fun lineTo(x: Float, y: Float): Path

Adds a line to the last series from the last add point to [x,y] If it is a the first point, it will becomes the Path starting point

Link copied to clipboard
fun moveTo(x: Float, y: Float): Path

Create a new line series starting at [x,y]

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 setPath(xys: FloatArray, ys: FloatArray, size: Int, clonePoints: Boolean = true): Path

Add a series point to the ui element