Game Resolution
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 18
- Joined: Tue Apr 24, 2018 7:37 pm
Game Resolution
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?
- pragmaticus
- Prole
- Posts: 26
- Joined: Mon Aug 20, 2018 1:13 pm
Re: Game Resolution
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
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Game Resolution
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.
- 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 True 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.
-
- Prole
- Posts: 18
- Joined: Tue Apr 24, 2018 7:37 pm
Who is online
Users browsing this forum: Bing [Bot] and 4 guests