On this page
ui.print
Draws text over the video feed using a font value and normalized x/y coordinates.
Syntax
Atlas Script
ui.print(font, x, y, string)Parameters
font- Atlas font value, usually created with font.create or supplied by font.default.
x- Horizontal component or X coordinate for the requested operation.
y- Vertical component or Y coordinate for the requested operation.
string- Text string rendered by the UI operation.
Return value
See the remarks for the returned value and runtime behavior.
Remarks
Draws text over the video feed using a font value and normalized x/y coordinates. The current VM assigns every ui.print call the same ui-font ID, so any later ui.print replaces the previous printed text even when it uses a different font value.
Examples
Draw text and a status message.atlas
font hud = font.create(1.4, rgb.lime);
event on_frame() {
ui.print(hud, 0.05, 0.08, string.format("Frame {}", frame));
ui.status(string.format("Runtime age {} ms", time_ms));
}
event on_stop() {
ui.clear();
}