Page 1 of 1

Game Resolution

Posted: Thu Aug 23, 2018 7:02 pm
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?

Re: Game Resolution

Posted: Fri Aug 24, 2018 3:38 pm
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

Re: Game Resolution

Posted: Fri Aug 24, 2018 3:49 pm
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.

Re: Game Resolution

Posted: Sat Aug 25, 2018 1:54 pm
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.