This is my first post here. I just started out with love.
I tried to set my window mode to the highest possible ratio. That worked fine.
I wanted to test the behavior when I lower the Desktop Dimensions from my OS (Windows 8.0).
My current Desktop Dimension is 1600x900
The highest possible Mode is 1920x1080 (Note: This is higher than the Desktop D.)
The script below reads out the highest possible values and applies these to the window:
Code: Select all
function love.load()
modes = love.window.getFullscreenModes() --Get all Modes available on my PC
table.sort(modes, function(a, b) return a.width*a.height > b.width*b.height end) --Sort the modes array (highest first)
success = love.window.setMode(modes[1].width, modes[1].height, {fullscreen=true}) --Set highest mode and fullscreen
if success then
Message = "Success" --love sais setMode was successful
else
Message = "Failed" --setMode failed
end
end
function love.draw()
love.graphics.print('Highest availible Mode: '..modes[1].width..'_'..modes[1].height, 100, 100) --highest Mode
local width, height = love.window.getMode() --Get current Mode (should be highest one)
love.graphics.print('Current Mode: '..width..'_'..height) --Print Current mode
love.graphics.print('love.window.setMode sais: '..Message, 250, 250) --Print setMode message
end
After minimizing the game using the windows button and maximizing it again, I then have the desired and highest resolution (1920x1080).
Why isn't this mode set from the beginning on and what can I do to change this?