Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I currently develop a game for Android in OpenGL ES 1.0, use libgdx library. I target the 720x480 screen size.

For example, I design only one arts pack for 720x480. And what will happen in Android phones with screen-size smaller or bigger than it, 480x320 for instance? Could you please tell me how to change the scale-policy of OpenGL ES in Android? Or in libgdx specially?

Is there anything like "Resample Image" like photoshop?(Nearest Neighbor, Bilinear, Bicubic etc..) for libgdx?

Edit: I found some tutorials about texture filter in OpenGL, test it with Linear and Nearest. Linear is good for scaling but slow down the game, and Nearest is on the contrary. What should I do to get a balance between those?

share|improve this question
give a check to this link blog.acamara.es/2012/02/05/… – petervaz Apr 6 at 0:04

1 Answer

The best policy for something like this is to make multiple assets. One for the larger screen size and another for the smaller screen size. Alternatively choose a middle ground and compromise slightly on performance.

Then when you first start your app, before loading any of the assets, check the dimensions of the screen using

Gdx.graphics.getWidth();
Gdx.graphics.getHeight();

and chose the correct assets to load respectively.

Another helpful hint is that if you want to maintain aspect ration on Android you can use

 AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
 cfg.resolutionStrategy = new RatioResolutionStrategy(16, 9);
 initialize(new MyGdxGame(), cfg);

in your Android Application. On say a 4:3 tablet (like my HP Touchpad) this puts black bars around my application, making it 16:9

Hope this helps

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.