I am making a videogame and I want to be able to use fullscreen with any computer. The problem comes when switching from fullscreen to normal, it offsets everything I draw up and left. Look at this and you will understand:
Without going to fullscreen. Looks ok. (Looks like this the first time I open it).
Looking good in fullscreen. (Ignore those white rectangles, it's puush).
After going out of fullscreen, you can see "Hello World" is out of the window and the width and height variables are out of place.
In fullscreen it works just right, even after having it bugged. The problem comes when going from fullscreen to normal.
This is the code:
Code: Select all
function love.load() fullscreen = false; width = love.window.getWidth(); height = love.window.getHeight(); end function love.draw() love.graphics.print("Hello World",0,0); love.graphics.print("W :"..width,0,50); love.graphics.print("H :"..height,0,60); end function love.mousepressed(x,y,button) if button == "l" then if fullscreen == false then love.window.setFullscreen(true, desktop); fullscreen = true; width = love.window.getWidth(); height = love.window.getHeight(); else love.window.setFullscreen(false, desktop); fullscreen = false; width = love.window.getWidth(); height = love.window.getHeight(); end end end
I am using version 9 of LÖVE but I downloaded it when it first came out, should I download a lastest version?