2x screen size
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
2x screen size
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).
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: 2x screen size
Take a look at love.graphics.setMode and conf.lua.
Re: 2x screen size
You can change all the window setting in conf.lua
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: 2x screen size
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
Well if you're doing things with shapes like rectangles, then you could do something along the lines of
But for the others, I'm not sure.
Code: Select all
function love.load()
ss=1
end
function love.draw()
love.graphics.rectangle('fill',0,0,5*ss,5*ss)
end
Losing a friend's trust is the fastest way to lose a friend, forever. FOREVER!
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: 2x screen size
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.
EDIT: Note, you probably want to work with love.graphics.setDefaultImageFilter too, if you're scaling everything up.
Re: 2x screen size
Thanks bartbes, that did it! Now I just have to figure out why my game stopped working when I upgraded to 0.8.0...
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: 2x screen size
Or do you use love.timer.sleep?
Re: 2x screen size
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.
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.
wat ya mean she's in another castle!?
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot], Semrush [Bot] and 3 guests