From 72b490766b1bcda5514727e5941df96c65f4d6d9 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Wed, 21 Dec 2022 20:52:26 +0530 Subject: [PATCH] text selection color fix --- src/gui/EnterNameDlg.hx | 3 +++ src/gui/GuiTextInput.hx | 2 +- src/gui/SearchGui.hx | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/EnterNameDlg.hx b/src/gui/EnterNameDlg.hx index 9263ce6e..48a6326c 100644 --- a/src/gui/EnterNameDlg.hx +++ b/src/gui/EnterNameDlg.hx @@ -56,6 +56,9 @@ class EnterNameDlg extends GuiControl { this.addChild(dlg); var enterNameEdit = new GuiTextInput(domcasual32); + enterNameEdit.text.textColor = 0; + enterNameEdit.text.selectionColor.setColor(0xFFFFFFFF); + enterNameEdit.text.selectionTile = h2d.Tile.fromColor(0x808080, 0, hxd.Math.ceil(enterNameEdit.text.font.lineHeight)); enterNameEdit.position = new Vector(28, 130); enterNameEdit.extent = new Vector(363, 38); enterNameEdit.text.text = Settings.highscoreName; diff --git a/src/gui/GuiTextInput.hx b/src/gui/GuiTextInput.hx index b6b752e8..6fbec019 100644 --- a/src/gui/GuiTextInput.hx +++ b/src/gui/GuiTextInput.hx @@ -20,7 +20,7 @@ class GuiTextInput extends GuiControl { public function new(font:h2d.Font) { super(); this.text = new TextInput(font); - this.text.textColor = 0; + // this.text.textColor = 0; this.text.onChange = () -> { if (onTextChange != null) { onTextChange(this.text.text); diff --git a/src/gui/SearchGui.hx b/src/gui/SearchGui.hx index 360462e3..884a139f 100644 --- a/src/gui/SearchGui.hx +++ b/src/gui/SearchGui.hx @@ -129,6 +129,9 @@ class SearchGui extends GuiImage { this.addChild(searchTitle); var searchEdit = new GuiTextInput(domcasual24); + searchEdit.text.textColor = 0; + searchEdit.text.selectionColor.setColor(0xFFFFFFFF); + searchEdit.text.selectionTile = h2d.Tile.fromColor(0x808080, 0, hxd.Math.ceil(searchEdit.text.font.lineHeight)); searchEdit.position = new Vector(91, 19); searchEdit.extent = new Vector(373, 29); searchEdit.onTextChange = (txt) -> {