Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Different texture for multiple resolution

Tags:

libgdx

How to use different texture(image) for different resolution in libGDX? Also specify how to detect it from asset folder?

I have to store different resolution images in different folder that thing you guide me and please give specific example.

like image 821
Siddharth Avatar asked Mar 23 '26 20:03

Siddharth


1 Answers

Use the AssetManager to load your resources. When loading resources, you can use different "File Resolvers" to figure out which specific asset to load based on your environment. For a screen resolution based decision, use a ResolutionFileResolver.

The AssetManagerTest demonstrates this pretty well.

like image 108
P.T. Avatar answered Mar 25 '26 13:03

P.T.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!