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 257e4e8f7..cefd356b3 100644 --- a/SPD-classes/src/main/java/com/watabou/noosa/TextInput.java +++ b/SPD-classes/src/main/java/com/watabou/noosa/TextInput.java @@ -33,7 +33,7 @@ public class TextInput extends Component { private NinePatch bg; - public TextInput( NinePatch bg, boolean multiline ){ + public TextInput( NinePatch bg, boolean multiline, int size ){ super(); this.bg = bg; add(bg); @@ -52,10 +52,8 @@ public class TextInput extends Component { skin = new Skin(FileUtils.getFileHandle(Files.FileType.Internal, "gdx/textfield.json")); - int zoom = (int) Camera.main.zoom; - int textSize = multiline ? 6 : 9; TextField.TextFieldStyle style = skin.get(TextField.TextFieldStyle.class); - style.font = Game.platform.getFont(textSize*zoom, "", false, false); + style.font = Game.platform.getFont(size, "", false, false); style.background = null; textField = multiline ? new TextArea("", style) : new TextField("", style); textField.setProgrammaticChangeEvents(true); @@ -65,7 +63,7 @@ public class TextInput extends Component { textField.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { - BitmapFont f = Game.platform.getFont(textSize*zoom, textField.getText(), false, false); + BitmapFont f = Game.platform.getFont(size, textField.getText(), false, false); TextField.TextFieldStyle style = textField.getStyle(); if (f != style.font){ style.font = f; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/WndTextInput.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/WndTextInput.java index 9b1a0392b..924ae5e0c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/WndTextInput.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/WndTextInput.java @@ -38,7 +38,8 @@ public class WndTextInput extends Window { txtTitle.setPos((width - txtTitle.width()) / 2, 2); add(txtTitle); - TextInput textBox = new TextInput(Chrome.get(Chrome.Type.TOAST_WHITE), multiLine); + int textSize = (int)PixelScene.uiCamera.zoom * (multiLine ? 6 : 9); + TextInput textBox = new TextInput(Chrome.get(Chrome.Type.TOAST_WHITE), multiLine, textSize); if (initialValue != null) textBox.setText(initialValue); textBox.setMaxLength(maxLength);