move the dialog up to avoid keyboard covering it

This commit is contained in:
RandomityGuy 2022-12-23 14:43:56 +05:30
parent 15155aecaf
commit 04a3a4007f

View file

@ -65,6 +65,16 @@ class EnterNameDlg extends GuiControl {
haxe.Timer.delay(() -> {
enterNameEdit.text.focus();
}, 5);
enterNameEdit.text.onFocus = (e) -> {
dlg.vertSizing = Bottom;
dlg.position = new Vector(110, 56);
dlg.render(MarbleGame.canvas.scene2d);
}
enterNameEdit.text.onFocusLost = (e) -> {
dlg.vertSizing = Center;
dlg.position = new Vector(110, 112);
dlg.render(MarbleGame.canvas.scene2d);
}
var okbutton = new GuiButton(loadButtonImages("data/ui/endgame/ok"));
okbutton.position = new Vector(151, 184);