From 04a3a4007fb8eb63f1a08dbe1484e0292e60009c Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Fri, 23 Dec 2022 14:43:56 +0530 Subject: [PATCH] move the dialog up to avoid keyboard covering it --- src/gui/EnterNameDlg.hx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gui/EnterNameDlg.hx b/src/gui/EnterNameDlg.hx index d82836c1..5b44ea02 100644 --- a/src/gui/EnterNameDlg.hx +++ b/src/gui/EnterNameDlg.hx @@ -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);