From e7a8fdf5760ec10e0b85537209552e7afc6283e6 Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Fri, 22 Sep 2023 22:53:36 -0700 Subject: [PATCH] implement nuke button --- bitplane-thingie.p8 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bitplane-thingie.p8 b/bitplane-thingie.p8 index bfa5610..3cb643f 100644 --- a/bitplane-thingie.p8 +++ b/bitplane-thingie.p8 @@ -57,7 +57,7 @@ function _update60() if segment then mouse_y = 111 elseif not was_click then - handle_ui_click(x, y) + handle_ui_click(mouse_x, mouse_y) end end @@ -128,6 +128,15 @@ function draw_ui_checkbox(x, checked, n) end function handle_ui_click(x, y) + -- out of range + if (x < 3 or x > 125) return + + -- nuke button + if x <= 12 and y > 114 and y < 125 then + cls() + return + end + end -->8 -- draw_cursor