Any way to proper toggleFullscreen function
Posted: Tue Jul 24, 2018 4:37 pm
Hellow everyone, I've tried coding like that
But in case of 'fullscreen mode' > 'windowed mode' you get window adjusted to screen size
Then I coded
where _config is some global to link to conf table. Is there better way to code toggleFullscreen function without making globals?
Code: Select all
love.window.setFullscreen(not love.window.getFullscreen())
Then I coded
Code: Select all
local fsc_val = love.window.getFullscreen()
if fsc_val then
love.window.updateMode(_config.window.width, _config.window.height, {fullscreen = false})
else
love.window.setFullscreen(true)
end