path

fun path(pathPoints: List<Vec2f>, thickness: Int = this.thickness, joinType: JoinType = if (isJoinNecessary(thickness)) JoinType.SMOOTH else JoinType.NONE, open: Boolean = true, color: Float = colorBits)

Draws a path by drawing a line between each point and the next.

The points at which two lines connect can be mitered to give a smooth join. Note that this may cause strange looking joins when the angle between connected lines approaches π, as the miter can get arbitrarily long. For thin line where the miter cannot be seen, you can set joinType to JoinType.NONE.

Only a subset of the path containing unique consecutive points (up to some small error) will be considered. For example, the paths (0,0), (1.001, 1, (1, 1), (2, 2) and (0,0), (1,1), (2,2) will be drawn identically.

If pathPoints is empty nothing will be drawn, if it contains wo points line will be used.

Parameters

pathPoints

a list of Vec2f containing the ordered points in the path

thickness

the thickness of the line in world units

joinType

the type of join, see JoinType

open

if false then the first and last points are connected

color

the packed color to draw the outline. See Color.toFloatBits.


fun path(pathPoints: FloatArray, thickness: Int = this.thickness, joinType: JoinType = if (isJoinNecessary(thickness)) JoinType.SMOOTH else JoinType.NONE, start: Int = 0, end: Int = pathPoints.size, open: Boolean = true, color: Float = colorBits)

Draws a path by drawing al ine between each point and the next. See path for details.

Parameters

pathPoints

a FloatArray containing the ordered points in the path

thickness

the thickness of the line in world units

joinType

the type of join, see JoinType

start

the index of pathPoints which represents the first point to draw, inclusive

end

the index of pathPoints which represents the last point to draw, exclusive

open

if false then the first and last points are connected

color

the packed color to draw the outline. See Color.toFloatBits.