Sure thing. But scenes are most often switched in love.update via a timer or similar. The person who asked was having a problem during the loading of a game, and explicitly specified: "My canvas creation and drawing only gets called once".
push - a resolution-handling library
Re: push - a resolution-handling library
Re: push - a resolution-handling library
This is a great library from what I've seen but I've found one problem. Whenever I go to play my game, a game window opens and closes immediately after. Then a second window opens and the game starts. I've tried to see what's causing the error but I honestly just don't understand any of the push.lua code. So is this just me having the issue or is this a general problem. Also if anyone knows how to fix this I would greatly appreciate the knowledge 
Edit: nevermind I fixed the problem, if you replace the lines
windowUpdateMode(self._RWIDTH, self._RHEIGHT, {
fullscreen = self._fullscreen,
resizable = self._resizable,
highdpi = self._highdpi
})
with this set of lines
local currentWidth, currentHeight, flags = love.window.getMode()
-- Only update the window mode if the settings actually changed
if currentWidth ~= self._RWIDTH or currentHeight ~= self._RHEIGHT
or flags.fullscreen ~= self._fullscreen
or flags.resizable ~= self._resizable then
love.window.setMode(self._RWIDTH, self._RHEIGHT, {
fullscreen = self._fullscreen,
resizable = self._resizable,
highdpi = self._highdpi
})
end
the error stops occurring and the screen opens normally

Edit: nevermind I fixed the problem, if you replace the lines
windowUpdateMode(self._RWIDTH, self._RHEIGHT, {
fullscreen = self._fullscreen,
resizable = self._resizable,
highdpi = self._highdpi
})
with this set of lines
local currentWidth, currentHeight, flags = love.window.getMode()
-- Only update the window mode if the settings actually changed
if currentWidth ~= self._RWIDTH or currentHeight ~= self._RHEIGHT
or flags.fullscreen ~= self._fullscreen
or flags.resizable ~= self._resizable then
love.window.setMode(self._RWIDTH, self._RHEIGHT, {
fullscreen = self._fullscreen,
resizable = self._resizable,
highdpi = self._highdpi
})
end
the error stops occurring and the screen opens normally

Last edited by Pezy on Fri Feb 28, 2025 9:25 pm, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 2 guests