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:
- Why is it not getting stretched to full screen
- Why is the device resolution returned lower
PS: I am using landscape mode only. Target resolution: 800x480 Please advice.