natiny.render.text_ex

Lua
natiny.render.text_ex(font, x, y, text [, origin_x, origin_y, rotation])

Draws an unwrapped UTF-8 text block with a local origin and rotation.

Parameters

Name Type Default Description
font number Font handle from natiny.font.create
x, y number Position of the local origin on the current target, in drawing units
text string UTF-8 text to draw
origin_x number 0 Horizontal origin offset from the block's left edge, in drawing units
origin_y number 0 Vertical origin offset from the block's top edge, in drawing units
rotation number 0 Clockwise rotation around (x, y), in degrees

Example

Lua
local text = "SPIN"
local w, h = natiny.font.measure_text(font, text)

natiny.render.text_ex(font, 400, 300, text, w / 2, h / 2, angle)