From 90ee66a3a6aae10fd84f3f43844db55229933e37 Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Sun, 12 Jan 2025 22:45:37 -0600 Subject: work --- src/ui.moon | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ui.moon') diff --git a/src/ui.moon b/src/ui.moon index 7a06522..4746302 100644 --- a/src/ui.moon +++ b/src/ui.moon @@ -1,5 +1,6 @@ hc = require("party.hardoncollider.init") win = require("window") +log = require("log") Button = require("ui.button") Joystick = require("ui.joystick") Textbox = require("ui.textbox") @@ -29,6 +30,7 @@ ui.joystick = (x,y,r) -> ui.node\append(joystick.node) bounds = ui_world\circle(x,y,r) ui.events.touch[bounds] = joystick + joystick ui.textbox = (x,y,width,height,value,placeholder) -> value = value or "" @@ -38,6 +40,7 @@ ui.textbox = (x,y,width,height,value,placeholder) -> bounds = ui_world\rectangle(x,y,width,height) ui.events.mouse[bounds] = textbox ui.events.keyboard[textbox] = true + textbox ui.node = am.group! @@ -69,10 +72,13 @@ ui.node\action(() -> match = ui.events.mouse[collider] if match has_fire(match) + --log.info("Found button under mouse:" .. tostring(match), {"ui","mouseover"}) match\fire(mo_tbl) if down + log.info("Found button under mouse:" .. tostring(match), {"ui","mousedown"}) match\fire(md_tbl) if up + log.info("Found button under mouse:" .. tostring(match), {"ui","mouseup"}) match\fire(mu_tbl) if math.length(wheel) > 0 etbl = -- cgit v1.2.3-70-g09d2