Game Resolution

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.
Post Reply
ITISITHEBKID
Prole
Posts: 18
Joined: Tue Apr 24, 2018 7:37 pm

Game Resolution

Post by ITISITHEBKID »

What are some good tutorials to learn about game resolution? I have a very bad understanding of it right now. I would like my game to be playable in many different resolution. Should I make all my sprites 16:9?
User avatar
pragmaticus
Prole
Posts: 26
Joined: Mon Aug 20, 2018 1:13 pm

Re: Game Resolution

Post by pragmaticus »

One approach could be, to draw everything in a relatively large offscreen canvas and finally draw the canvas, scaled to the specific resolution, on screen.

Code: Select all

function love.draw()
	love.graphics.setCanvas(offscreen) -- set offscreen canvas
	-- draw your stuff with high resolution sprites..
	love.graphics.setCanvas() -- set onscreen canvas
	love.graphics.draw(offscreen, 0, 0, 0, scale, scale) -- draw the scaled offscreen canvas on screen
end
User avatar
zorg
Party member
Posts: 3470
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Game Resolution

Post by zorg »

If you're only worried about the aspect ratio being wrong, then you have a few choices:
- Showing more of the world on one axis on screens not with the intended aspect ratio;
- Zooming in until the longer axis gets completely filled, still caring about the aspect ratio;
- Letterboxing/Pillarboxing, basically showing less on one axis on screens not with the intended aspect ratio;
- Stretching without any care for the correct aspect ratio.

The first three options are acceptable, and were used in many games, although the type of game dictated which made sense to be used; the last one i'd really not recommend under any circumstances whatsoever.

To be honest, i'd say think about your graphics as having the aspect ratio of 1:1, and then, on-screen, show as much content as you can, depending on the ratio of the actual screen the user is playing on.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
ITISITHEBKID
Prole
Posts: 18
Joined: Tue Apr 24, 2018 7:37 pm

Re: Game Resolution

Post by ITISITHEBKID »

zorg wrote: Fri Aug 24, 2018 3:49 pm - Showing more of the world on one axis on screens not with the intended aspect ratio;
Thanks for your reply! I will use this solution.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests