v3.2.3: implemented mostly complete new iOS inset support
This commit is contained in:
committed by
Evan Debenham
parent
0a6a93ec47
commit
452f944678
@@ -50,9 +50,6 @@ public class Game implements ApplicationListener {
|
||||
public static int width;
|
||||
public static int height;
|
||||
|
||||
//number of pixels from bottom of view before rendering starts
|
||||
public static int bottomInset;
|
||||
|
||||
// Density: mdpi=1, hdpi=1.5, xhdpi=2...
|
||||
public static float density = 1;
|
||||
|
||||
@@ -136,7 +133,6 @@ public class Game implements ApplicationListener {
|
||||
Vertexbuffer.reload();
|
||||
}
|
||||
|
||||
height -= bottomInset;
|
||||
if (height != Game.height || width != Game.width) {
|
||||
|
||||
Game.width = width;
|
||||
|
||||
@@ -172,7 +172,7 @@ public class NoosaScript extends Script {
|
||||
|
||||
Gdx.gl20.glScissor(
|
||||
Math.round(camera.x * xScale),
|
||||
Math.round((Game.height - camera.screenHeight - camera.y) * yScale) + Game.bottomInset,
|
||||
Math.round((Game.height - camera.screenHeight - camera.y) * yScale),
|
||||
Math.round(camera.screenWidth * xScale),
|
||||
Math.round(camera.screenHeight * yScale));
|
||||
} else {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class TextInput extends Component {
|
||||
//use a custom viewport here to ensure stage camera matches game camera
|
||||
Viewport viewport = new Viewport() {};
|
||||
viewport.setWorldSize(Game.width, Game.height);
|
||||
viewport.setScreenBounds(0, Game.bottomInset, Game.width, Game.height);
|
||||
viewport.setScreenBounds(0, 0, Game.width, Game.height);
|
||||
viewport.setCamera(new OrthographicCamera());
|
||||
//TODO this is needed for the moment as Spritebatch switched to using VAOs in libGDX v1.13.1
|
||||
// This results in HARD crashes atm, whereas old vertex arrays work fine
|
||||
|
||||
@@ -66,7 +66,7 @@ public class DeviceCompat {
|
||||
|
||||
//...and in the Y dimension
|
||||
public static float getRealPixelScaleY(){
|
||||
return ((Gdx.graphics.getBackBufferHeight()-Game.bottomInset) / (float)Game.height );
|
||||
return (Gdx.graphics.getBackBufferHeight() / (float)Game.height );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user