On this page
ui.clear
With no argument, clears every ui- prefixed drawing; with a handle or ID, clears that one drawing.
Syntax
Atlas Script
ui.clear(handle_or_id?)Parameters
handle_or_idOptional- Optional drawing handle returned by ui.rect, ui.line, or ui.circle, or the stable ID originally supplied to that drawing. Omit it to clear every ui-prefixed drawing.
Return value
See the remarks for the returned value and runtime behavior.
Remarks
With no argument, clears every ui- prefixed drawing; with a handle or ID, clears that one drawing. on_frame already clears ui- drawings before redrawing. ui.status uses the separate status ID and is cleared with ui.status(""), not ui.clear().
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();
}