I'm making a pixel art game for let's say, 1280x720. I'm using the Push library to scale the virtual resolution to whatever the monitor's resolution is. When upscaled to something like 1920x1080 some of the sprites get slightly distorted or changed. I understand why that happens but what's the best solution for this problem?
One way I can think of is to not upscale it at all which would create a larger viewport showing more map area on the screen. Another way is to create assets for different resolutions which I honestly can't afford to do. Just wondering how you guys handle this for your games and also does anyone know how other games like stardew valley handle this? Do they upscale the resolution or just make the viewport bigger? Thanks.
How to handle scaling to different resolutions?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 2
- Joined: Wed Jan 02, 2019 7:44 am
Re: How to handle scaling to different resolutions?
I'm mostly developing for resolution of 800x600 pixels and later upscaling it like this:
Its not the best solution but works for most screen resolutions
A little example (Love2d 11.1):
Code: Select all
function love.load()
original_width = 800
original_height = 600
window_width,window_height = love.graphics.getDimensions()
window_scale_y = window_height/original_height
window_scale_x = window_scale_y
window_translate_x = (window_width - (window_scale_x*original_width))/2
function love.draw()
love.graphics.translate(window_translate_x,0)
love.graphics.scale(window_scale_x,window_scale_y)
--Drawing--
love.graphics.setColor(0,0,0)
love.graphics.rectangle("fill",-window_translate_x,0,window_translate_x/2,original_height)
love.graphics.rectangle("fill",original_width ,0,window_translate_x/2,original_height)
end
end
A little example (Love2d 11.1):
Only trying to help
Re: How to handle scaling to different resolutions?
I think there shouldn't be any issues scaling 1280x720 to 1920x1080, since you keep the same aspect ratio. In other cases, I would center the canvas in the window keeping the canvas ratio and leaving two black bars where necessary.
More details here: viewtopic.php?t=83406#p208548
More details here: viewtopic.php?t=83406#p208548
NIL
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests