method
Screen.measure_text
Screen.measure_text(text) -> int
Returns the width in pixels that text occupies in the built-in 5x7 font at scale 1 — 6 pixels per glyph, matching how Screen.draw_text advances. Use it to right-align or centre text, size a label's background, or lay out a menu.
Example
program Demo {
handler DrawWorld phase Render {
let label = "READY"
let w = Screen.measure_text(label)
Screen.draw_text(x: 160 - w / 2, y: 100, text: label, color: Color.White, scale: 1)
Screen.show()
}
}