Try to react to resizing events properly
Maybe doesn't work because of bad HiDPI-Scaling on macOS?
This commit is contained in:
parent
7f37985996
commit
ec06159c84
1 changed files with 20 additions and 8 deletions
|
|
@ -13,18 +13,25 @@ end
|
|||
|
||||
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()
|
||||
print("Hello World!")
|
||||
warning("Hello Warning!")
|
||||
|
||||
|
||||
img = fill_surface(VRESW, VRESH, 0xff, 0x77, 0x00)
|
||||
cursor_setstorage(WORLDID)
|
||||
init_shapes()
|
||||
|
||||
show_image(img)
|
||||
show_image(cursor)
|
||||
cursor_setstorage(WORLDID)
|
||||
end
|
||||
|
||||
|
||||
|
|
@ -45,6 +52,11 @@ end
|
|||
|
||||
function exercise1_input_end()
|
||||
x, y = cursor_position()
|
||||
move_image(cursor, x, y, TICK_DELAY)
|
||||
warning("" .. x .. ", " .. y)
|
||||
move_image(shapes.cursor, x, y, TICK_DELAY)
|
||||
warning("Mouse: " .. x .. ", " .. y)
|
||||
end
|
||||
|
||||
function exercise1_display_state(action, id, state)
|
||||
warning("Res: " .. VRESW .. ", " .. VRESH)
|
||||
init_shapes()
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue