import "luxe: ui/control" for Control import "luxe: world" for UI import "luxe: render" for TextAlign class UISimpleText{ static font{"assets/fonts/BabyBlocks"} static size{8} static create(ent){ var text = Control.create(ent) Control.set_state_data(text, {"text": ""}) Control.set_size(text, 100, size) Control.set_render(text) {|control, state, x, y, w, h| UI.draw_text(control, x, y + size/2, 0, state["text"], size, font, [1,1,1,1], TextAlign.left, TextAlign.top) } return text } static set_text(con, text){ var data = Control.get_state_data(con) data["text"] = text } }