Skip to content

drawText

Draws text on screen.

TIP

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

Syntax

lua
Ham.drawText(text, position, color, fontSize, centered, outline, outlineColor)

Parameters

NameTypeDescription
textstringText to draw (supports multiline with \n)
positiontablePosition {x, y}
colortableText color {r, g, b, a}
fontSizefloatFont size in pixels (optional, default 12)
centeredbooleanCenter text horizontally (optional, default false)
outlinebooleanDraw text outline (optional, default false)
outlineColortableOutline color (optional, default black)

Example

lua
Ham.drawText("Hello World!", {100, 100}, {255, 255, 255, 255}, 16, false, true, {0, 0, 0, 255})

See Also

Released under the ISC License.