Skip to content

drawLine

Draws a line between two points.

TIP

All drawing functions should be called within a render callback/loop.

Syntax

lua
Ham.drawLine(startPos, endPos, color, thickness)

Parameters

NameTypeDescription
startPostableStart position {x, y} or {x=..., y=...}
endPostableEnd position {x, y} or {x=..., y=...}
colortableColor {r, g, b, a} (0-255 each)
thicknessintegerLine thickness in pixels (1-100)

Example

lua
Ham.drawLine({100, 100}, {200, 200}, {255, 0, 0, 255}, 2)

See Also

Released under the ISC License.