Fortunately you can make LÖVE use the desktop resolution if you set the width and height to 0.
Here's an example for LÖVE 0.7.1 and 0.7.2:
conf.lua
Code: Select all
function love.conf(t)
t.screen.width = 0
t.screen.height = 0
end
Use love.graphics.getWidth() and love.graphics.getHeight() if you want to switch to another resolution, but save the desktop width and height:
main.lua
Code: Select all
function love.load()
desktopWidth = love.graphics.getWidth()
desktopHeight = love.graphics.getHeight()
love.graphics.setMode(1280, 720, false, true, 0)
end
if you're still using LÖVE 0.7.0 you have to do it this way:
conf.lua
Code: Select all
function love.conf(t)
t.screen = nil -- LÖVE will not create a window if we nil this table
end
Code: Select all
function love.load()
love.graphics.setMode(0, 0, false, true, 0) -- Sets the resolution to the size of the desktop
end
19-02-2011: With 0.7.1 released it's better to point at the easier version first.
07-04-2011: Deleted the stuff about it being only possible once.