Try to react to resizing events properly

Maybe doesn't work because of bad HiDPI-Scaling on macOS?
This commit is contained in:
Felix Uhl 2025-06-12 15:54:57 +02:00
parent 7f37985996
commit ec06159c84

View file

@ -13,18 +13,25 @@ end
TICK_DELAY = 1 / 25 TICK_DELAY = 1 / 25
local cursor = color_surface(8, 8, 0, 0, 0) shapes = { }
function init_shapes()
if shapes.img ~= nil then hide_image(shapes.img) end
if shapes.cursor ~= nil then hide_image(shapes.cursor) end
shapes.cursor = color_surface(8, 8, 0, 0, 0)
shapes.img = fill_surface(VRESW, VRESH, 0xff, 0x77, 0x00)
show_image(shapes.img)
show_image(shapes.cursor)
end
function exercise1() function exercise1()
print("Hello World!") print("Hello World!")
warning("Hello Warning!") warning("Hello Warning!")
init_shapes()
img = fill_surface(VRESW, VRESH, 0xff, 0x77, 0x00)
cursor_setstorage(WORLDID) cursor_setstorage(WORLDID)
show_image(img)
show_image(cursor)
end end
@ -45,6 +52,11 @@ end
function exercise1_input_end() function exercise1_input_end()
x, y = cursor_position() x, y = cursor_position()
move_image(cursor, x, y, TICK_DELAY) move_image(shapes.cursor, x, y, TICK_DELAY)
warning("" .. x .. ", " .. y) warning("Mouse: " .. x .. ", " .. y)
end
function exercise1_display_state(action, id, state)
warning("Res: " .. VRESW .. ", " .. VRESH)
init_shapes()
end end