Hello there!
I would like to know how people that use Löve makes your game to run in different screen resolutions. Any good library for this? I used Java Libgdx and it has the Viewports to make my drawables fit in any screen resolution (using virtual dimensions), but I don't know if Löve has this feature.
Thanks for support!
Making a game for multiple resolutions
Re: Making a game for multiple resolutions
When working with 2D art, there's really no general solution to this problem. It depends on the type of game, and your art. For my old game, Hat Cat, it naturally supports zooming and panning, so just letting the windows become bigger worked just fine. For other games, hardcoding it for a handful of resolutions might be easier (and just scale or black bar the closest one when the display doesn't match). For mobile games, I'd target 480p and 720p. For computers/video games, I'd target 720p and 1080p.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Making a game for multiple resolutions
For mobile I would imagine 720 and 1080 would be good too. I would assume most Android phones being sold now are at least 720 and high dpi.
Re: Making a game for multiple resolutions
A ridiculously high amount of phones isn't even 720p, so targeting 480p for mobile could still be needed.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: Making a game for multiple resolutions
About resolution I got it, but how can I make them fit in all screen sizes by programming?
Re: Making a game for multiple resolutions
I don't have knowledge about it, but my guess would be to use everything %.screenSize instead of #.fixedValue. But maybe not.
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Making a game for multiple resolutions
Depends on whether your game allows the visible area of the world being differently sized on different resolutions or not.Kibita wrote:About resolution I got it, but how can I make them fit in all screen sizes by programming?
If it's allowed, then you just show a bigger chunk of the world, no extra scaling and stuff. For an example, refer to OpenTTD.
If it isn't for whatever reason, like it would give someone an unfair advantage or disadvantage, then select one resolution to use as the "internal" resolution, then if the screen is more or less, adjust it with love.graphics.scale. With code:
Code: Select all
love.graphics.scale(screenWidth/internalWidth, screenHeight/InternalHeight)
Code: Select all
local ratio = math.min(screenWidth/internalWidth, screenHeight/InternalHeight)
love.graphics.scale(ratio, ratio)
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.
Re: Making a game for multiple resolutions
Hmm that's nice! Would be great if next love2d version would have this feature.Depends on whether your game allows the visible area of the world being differently sized on different resolutions or not.
If it's allowed, then you just show a bigger chunk of the world, no extra scaling and stuff. For an example, refer to OpenTTD.
If it isn't for whatever reason, like it would give someone an unfair advantage or disadvantage, then select one resolution to use as the "internal" resolution, then if the screen is more or less, adjust it with love.graphics.scale. With code:Do note that the above code will horribly distort the view if the aspect ratios don't match, so here's a fixed version that crops:Code: Select all
love.graphics.scale(screenWidth/internalWidth, screenHeight/InternalHeight)
The alternate of that would be to use math.max, which would get you no black bars anywhere, but parts of the view will be "outside" the screen.Code: Select all
local ratio = math.min(screenWidth/internalWidth, screenHeight/InternalHeight) love.graphics.scale(ratio, ratio)
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Making a game for multiple resolutions
What feature? You can code this on your own in about 2-3 lines, don't be lazy!
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.
Re: Making a game for multiple resolutions
Hahaha, sorry! I didn't want to mean that. I just tought that Love2d next time could have this: https://github.com/libgdx/libgdx/wiki/Viewportszorg wrote:What feature? You can code this on your own in about 2-3 lines, don't be lazy!
Who is online
Users browsing this forum: No registered users and 2 guests