Love resize error

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
ownims
Prole
Posts: 1
Joined: Mon Dec 16, 2019 2:51 pm

Love resize error

Post 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
User avatar
steVeRoll
Party member
Posts: 131
Joined: Sun Feb 14, 2016 1:13 pm

Re: Love resize error

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 213 guests