lovr.graphics.print

Draws text in 3D space using the active font.

lovr.graphics.print(str, x, y, z, scale, angle, ax, ay, az, wrap, halign, valign)

Arguments

NameTypeDefaultDescription
strstringThe text to render.
xnumber0The x coordinate of the center of the text.
ynumber0The y coordinate of the center of the text.
znumber0The z coordinate of the center of the text.
scalenumber1The scale of the text.
anglenumber0The number of radians to rotate the text around its rotation axis.
axnumber0The x component of the axis of rotation.
aynumber1The y component of the axis of rotation.
aznumber0The z component of the axis of rotation.
wrapnumber0The maximum width of each line, in meters (affected by scale). Set to 0 or nil for no wrapping.
halignHorizontalAlign'center'The horizontal alignment.
valignVerticalAlign'middle'The vertical alignment.

Returns

Nothing

Notes

Unicode text is supported.

Use \n to add line breaks.

LÖVR uses a fancy technique for font rendering called multichannel signed distance fields. This leads to crisp text in VR, but requires a special shader to use. LÖVR internally switches to the appropriate shader, but only when the default shader is already set. If you see strange font artifacts, make sure you switch back to the default shader by using lovr.graphics.setShader() before you draw text.

See also