In any case, thank you for your patience.
1 Like
Actually, values need to be updated in the callback of window.set_listener
:
window.set_listener(function(self, event, data)
if event == window.WINDOW_EVENT_RESIZED then
window_width, window_height = window.get_size()
zoom = math.min(
window_width / gui_width,
window_height / gui_height
)
gui.set_size(
rectangle,
vmath.vector3(
window_width / zoom,
window_height / zoom,
0
)
)
end
end)