diff --git a/src/gui/EnterNameDlg.hx b/src/gui/EnterNameDlg.hx index c3624512..7b19e9c2 100644 --- a/src/gui/EnterNameDlg.hx +++ b/src/gui/EnterNameDlg.hx @@ -51,6 +51,7 @@ class EnterNameDlg extends GuiImage { textInput.horizSizing = Width; textInput.vertSizing = Height; textInput.text.textColor = 0xEBEBEB; + textInput.setCaretColor(0xEBEBEB); textInput.text.selectionColor.setColor(0x8DFF8D); textInput.text.selectionTile = h2d.Tile.fromColor(0x88BCEE, 0, hxd.Math.ceil(textInput.text.font.lineHeight)); textFrame.addChild(textInput); diff --git a/src/gui/GuiTextInput.hx b/src/gui/GuiTextInput.hx index cd08b4a2..77d33f3c 100644 --- a/src/gui/GuiTextInput.hx +++ b/src/gui/GuiTextInput.hx @@ -82,4 +82,9 @@ class GuiTextInput extends GuiControl { } #end } + + public function setCaretColor(col:Int) { + text.cursorTile = h2d.Tile.fromColor(col, Std.int(1 / hxd.Window.getInstance().windowToPixelRatio), text.font.size); + text.cursorTile.dy = 2 / hxd.Window.getInstance().windowToPixelRatio; + } } diff --git a/src/gui/ReplayNameDlg.hx b/src/gui/ReplayNameDlg.hx index c6caee69..c4ea3276 100644 --- a/src/gui/ReplayNameDlg.hx +++ b/src/gui/ReplayNameDlg.hx @@ -48,6 +48,7 @@ class ReplayNameDlg extends GuiImage { textInput.horizSizing = Width; textInput.vertSizing = Height; textInput.text.textColor = 0xEBEBEB; + textInput.setCaretColor(0xEBEBEB); textInput.text.selectionColor.setColor(0x8DFF8D); textInput.text.selectionTile = h2d.Tile.fromColor(0x88BCEE, 0, hxd.Math.ceil(textInput.text.font.lineHeight)); textFrame.addChild(textInput);