fix caret color

This commit is contained in:
RandomityGuy 2024-06-07 20:58:25 +05:30
parent fa7b50486a
commit f5be65234f
3 changed files with 7 additions and 0 deletions

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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);