Page 1 of 1

Love resize error

Posted: Mon Dec 16, 2019 3:06 pm
by ownims
First, hello to everyone.
I tried to resize the window width based on the height, but I can't get the expected result, love looses the mouse click when resized
this happens because setMode call resize again.

The function i would need would be something like "ResizeEnd"

Code: Select all

function game.resize(w, h)
    aux = width/height
    
    --This not works to resize width only
    love.window.width = aux * h
    
    
    --This code cancel resize, releasing mouse 
    love.window.setMode(aux * h, h, {resizable=true, vsync=true, minwidth=400, minheight=300})button
end


sorry for Translation by google


edit 1 :
setMode needs to be called only once, after finishing resizing, I tried using mouseRelease to check if resizing is complete, but mouseRelease only captures the click inside a game window

Re: Love resize error

Posted: Wed Dec 18, 2019 2:13 pm
by steVeRoll
Unfortunately, due to how love works, it is impossible to run code while the window is being resized. love only has a "resize" callback, which is called as soon as you finish resizing.