1

I am trying to stretch the game to fullscreen using StretchViewPort. The game stretches full screen in android, desktop(tested multiple resolutions) and iPad4(retina). When i run the same game on iPhone 6 simulator, it is letterboxed on the sides(Landscape).

I tried to assign a viewport manually for testing using this code:

Gdx.gl.glViewport(0, 0, 100, 100);

As per my understanding this must have drawn the game from the left corner edge of the screen. But instead it left a small black space(letterbox size) on the left. Again works exactly as expected with desktop and android versions.

Additional info(Hopefully useful!) I tried getting screen dimensions using

UIScreen.getMainScreen().getBounds().getSize()

The result was: Screen size: 480.0X320.0

When I tried with Gdx.graphics.getWidth() and Gdx.graphics.getHeight() Screen size: 960X640

The actual device resolution is far greater.

Things I need to know:

  1. Why is it not getting stretched to full screen
  2. Why is the device resolution returned lower

PS: I am using landscape mode only. Target resolution: 800x480 Please advice.

Aqvin
  • 85
  • 5

1 Answers1

2

Well I figured it out myself. It appears I had accidentally deleted the launch screen images from the project. Found the reason and answer here:

App not sized properly iOS 8 iPhone simulator

Community
  • 1
  • 1
Aqvin
  • 85
  • 5