diff --git a/SPD-classes/src/main/java/com/watabou/noosa/Game.java b/SPD-classes/src/main/java/com/watabou/noosa/Game.java index 6785c41d9..84033e232 100644 --- a/SPD-classes/src/main/java/com/watabou/noosa/Game.java +++ b/SPD-classes/src/main/java/com/watabou/noosa/Game.java @@ -121,7 +121,8 @@ public class Game implements ApplicationListener { TextureCache.reload(); Vertexbuffer.refreshAllBuffers(); } - + + height -= bottomInset; if (height != Game.height || width != Game.width) { Game.width = width; diff --git a/SPD-classes/src/main/java/com/watabou/noosa/TextInput.java b/SPD-classes/src/main/java/com/watabou/noosa/TextInput.java index a401303e5..257e4e8f7 100644 --- a/SPD-classes/src/main/java/com/watabou/noosa/TextInput.java +++ b/SPD-classes/src/main/java/com/watabou/noosa/TextInput.java @@ -2,6 +2,7 @@ package com.watabou.noosa; import com.badlogic.gdx.Files; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Stage; @@ -12,6 +13,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.TextField; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.viewport.ScreenViewport; +import com.badlogic.gdx.utils.viewport.Viewport; import com.watabou.glscripts.Script; import com.watabou.glwrap.Blending; import com.watabou.glwrap.Quad; @@ -36,7 +38,12 @@ public class TextInput extends Component { this.bg = bg; add(bg); - stage = new Stage(new ScreenViewport()); + //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.setCamera(new OrthographicCamera()); + stage = new Stage(viewport); Game.inputHandler.addInputProcessor(stage); container = new Container(); diff --git a/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSPlatformSupport.java b/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSPlatformSupport.java index e0ad9b22d..cfeecb79c 100644 --- a/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSPlatformSupport.java +++ b/ios/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ios/IOSPlatformSupport.java @@ -33,8 +33,9 @@ public class IOSPlatformSupport extends PlatformSupport { } if (!SPDSettings.fullscreen()) { + int insetChange = Gdx.graphics.getSafeInsetBottom() - Game.bottomInset; Game.bottomInset = Gdx.graphics.getSafeInsetBottom(); - Game.height -= Game.bottomInset; + Game.height -= insetChange; Game.dispHeight = Game.height; } else { Game.height += Game.bottomInset; @@ -46,8 +47,11 @@ public class IOSPlatformSupport extends PlatformSupport { @Override public void updateSystemUI() { + int prevInset = Game.bottomInset; updateDisplaySize(); - ShatteredPixelDungeon.seamlessResetScene(); + if (prevInset != Game.bottomInset) { + ShatteredPixelDungeon.seamlessResetScene(); + } } @Override