Sign in to follow this  
scarypajamas

Best way to scale images?

Recommended Posts

Ok, so I got my game menu, and I have it so the buttons, images, and background scale accordingly to the resolution. The problem is I'm trying to find out the best way to scale my images without them looking stretched or pixelated. I assume there are some techniques for this? After all, how do all the 2d games do it?

Share this post


Link to post
Share on other sites
Or you can just show more of the game world at larger resolutions. That way you don't have to worry about different sized sprites. Of course, this could cause difficulty balancing issues, but that depends on the kind of game.

Share this post


Link to post
Share on other sites
Scale up and it pixelates. Scale down and you lost details - sometimes important ones. Best solution is to scale w/bilinear filtering. If you're using direct3d or the likes, you can get this automatically by lettings your textures be mipmapped and having the largest size you'll need on disk. When you scale down it'll select the best calculated-mipmap and you won't lose pieces of information though the details will be slightly blurred.

Share this post


Link to post
Share on other sites
Quote:
What about using a higher-quality picture to begin with, and just shrinking it down for the lower resolutions?


I've thought about this, but I'd like to try and find a solution that won't increase the download size.

Quote:
Scale up and it pixelates. Scale down and you lost details - sometimes important ones. Best solution is to scale w/bilinear filtering. If you're using direct3d or the likes, you can get this automatically by lettings your textures be mipmapped and having the largest size you'll need on disk. When you scale down it'll select the best calculated-mipmap and you won't lose pieces of information though the details will be slightly blurred.


I'll look into filtering.

Thanks for your suggestions everyone.

Share this post


Link to post
Share on other sites

Break things like UI buttons into 9 parts. For example, never scale the corners. Only scale the sides vertically or horizontally. Only scale the center both vertically + horizontally

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this