Quantcast
Channel: Question and Answer » libgdx
Viewing all articles
Browse latest Browse all 434

Choosing assets for different screen densities and sizes? (libGDX)

$
0
0

I am making a 2D game. As I understand it we typically have maybe 4 sets of assets (xxhdpi, xhdpi, hdpi, and mdpi) so that our game runs well on all devices. These are just scaled versions of the same asset.

First off, is this even necessary? My game won’t have that many textures to draw, so maybe I should just have one set of larger assets I can scale down. But assuming I go ahead with it…

What is the algorithm for choosing which version of an asset to use? I assume it depends on both density and overall screen size.

I am thinking of just deciding what percent of the screen I want an asset to take up, translating that to device pixels, rounding up to the next largest asset in my folder, and then scaling that image down when rendering it.

It this an appropriate technique? Or is there some tool that chooses the asset for me?


Viewing all articles
Browse latest Browse all 434

Trending Articles