Page 1 of 2
2x screen size
Posted: Thu May 17, 2012 6:05 am
by litearc
Hi, I was wondering if there is a way to double the screen size in LOVE. I read (somewhere) that there is no built-in way but you use the graphics functions to do a software scale. Is this right, and if so, will I need to use Canvas and Quad? Thanks, and sorry if this has been asked already (I couldn't find a topic on it).
Re: 2x screen size
Posted: Thu May 17, 2012 9:11 am
by bartbes
Re: 2x screen size
Posted: Thu May 17, 2012 5:48 pm
by Davidobot
You can change all the window setting in conf.lua
Re: 2x screen size
Posted: Thu May 17, 2012 7:33 pm
by litearc
Sorry, I meant do a 2x zoom. So if the game handles 320x240 pixels, there will be 640x480 pixels displayed since everything is zoomed 2x. I can't find an option for this in love.graphics.setMode or the conf.lua file.
Re: 2x screen size
Posted: Thu May 17, 2012 7:39 pm
by jradich
Well if you're doing things with shapes like rectangles, then you could do something along the lines of
Code: Select all
function love.load()
ss=1
end
function love.draw()
love.graphics.rectangle('fill',0,0,5*ss,5*ss)
end
But for the others, I'm not sure.
Re: 2x screen size
Posted: Thu May 17, 2012 9:14 pm
by bartbes
After setting the window to 2x the size, you just add love.graphics.scale(2) to the top of your love.draw.
EDIT: Note, you probably want to work with love.graphics.setDefaultImageFilter too, if you're scaling everything up.
Re: 2x screen size
Posted: Fri May 18, 2012 12:25 am
by litearc
Thanks bartbes, that did it! Now I just have to figure out why my game stopped working when I upgraded to 0.8.0...
Re: 2x screen size
Posted: Fri May 18, 2012 7:19 am
by Robin
Does it show an error?
Re: 2x screen size
Posted: Fri May 18, 2012 9:24 am
by bartbes
Or do you use love.timer.sleep?
Re: 2x screen size
Posted: Fri May 18, 2012 11:02 pm
by juno
Would it be easier to implement a camera instead? All objects on the screen are drawn relative to the camera's position, scale, and rotation...
So if the camera's scale is at x=2, y=2...you can fit twice as many pixels in.
This tutorial shows you how.