0

Currently I am using this method to "scale" the screen size of devices, and it works perfectly on my Nexus 5 (5" size) but on my Nexus 7 2012 (7" screen size) The width seems to be perfect I'd say, but the height is horrible. There's like 2 inches of black space on the very bottom.

@Override
public EngineOptions onCreateEngineOptions() {

    prefs = PreferenceManager.getDefaultSharedPreferences(this);
    camera = new FollowCamera(0, 0, Constants.CW, Constants.CH);
    IResolutionPolicy resolutionPolicy = new FillResolutionPolicy();
    EngineOptions engineOptions = new EngineOptions(true,
            ScreenOrientation.PORTRAIT_FIXED, resolutionPolicy, camera);
    engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
    engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
    return engineOptions;
}

And here are my constants

public static final int CW = 480; //Width of Game
public static final int CH = 800; //Height of Game

Could you guys help me fix this? Thank you.

Fernando
  • 450
  • 1
  • 7
  • 22

1 Answers1

1

I have given a similar answer in another link. So, hope my answer in the below link helps you:

andengine activity bg not fit the screen

Community
  • 1
  • 1
Sushil
  • 8,250
  • 3
  • 39
  • 71
  • Thank you very much, I found out my problem which brought another problem. But this fixed half of it. Thank you again. – Fernando Feb 28 '14 at 02:10