2x screen size

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
litearc
Citizen
Posts: 57
Joined: Thu May 17, 2012 12:40 am

2x screen size

Post 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).
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 2x screen size

Post by bartbes »

Take a look at love.graphics.setMode and conf.lua.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: 2x screen size

Post by Davidobot »

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
User avatar
litearc
Citizen
Posts: 57
Joined: Thu May 17, 2012 12:40 am

Re: 2x screen size

Post 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.
User avatar
jradich
Party member
Posts: 100
Joined: Mon Dec 12, 2011 8:44 pm

Re: 2x screen size

Post 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.
Losing a friend's trust is the fastest way to lose a friend, forever. FOREVER!
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 2x screen size

Post 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.
User avatar
litearc
Citizen
Posts: 57
Joined: Thu May 17, 2012 12:40 am

Re: 2x screen size

Post 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...
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: 2x screen size

Post by Robin »

Does it show an error?
Help us help you: attach a .love.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: 2x screen size

Post by bartbes »

Or do you use love.timer.sleep?
User avatar
juno
Citizen
Posts: 85
Joined: Thu May 10, 2012 4:32 pm
Location: London

Re: 2x screen size

Post 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.
wat ya mean she's in another castle!?
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 170 guests