Wozza
Wozza

Reputation: 622

fullscreen images and android resolutions

I have a game which displays a full screen image in the background. At the moment I have one image size (1280x800). This works well on large resolutions but on smaller screens the shrinking somewhat degrades the image. You can see jagged edges and it is noticeably worse than what you could achieve using photoshop software.

I have different image sizes, but I am unsure how to utilize them. I know there are different dpi folders, but you can have resolutions of 480x320 and 1280x768 with the same dpi so I don't think these can be of use here.

I believe you can have different layout files for different screen sizes, but the image is not drawn using xml (and in fact would not be possible for my game).

I can only think that I must create a different file name for each size. Then when choosing which image to use I could take the screen dimensions and select the correct one? I am struggling to see how I can make an image look good on both 240x320 and 1280x800 resolutions.

Upvotes: 3

Views: 3595

Answers (1)

devunwired
devunwired

Reputation: 63303

All of the resource qualifiers in the framework can be applied to drawables, not just the dpi designators. In other words, you could create folders like this to segment your images as well:

  • drawable-ldpi
  • drawable-xlarge
  • drawable-normal
  • drawable-sw480dp
  • drawable-sw720dp

Even examples like these work...

  • drawable-v10
  • drawable-land

And so on...

You can create as many or as few different qualified directories for your image assets as you think necessary to preserve the quality. The Supporting Multiple Screens article in the SDK docs helps describe most of the qualifiers that best fit scaling image assets.

HTH!

Upvotes: 4

Related Questions