some font stuffs for ui

This commit is contained in:
minjaesong
2023-06-18 21:40:06 +09:00
parent a33f0e7ab4
commit 138c6d22d2
9 changed files with 17 additions and 13 deletions

View File

@@ -167,8 +167,11 @@ class UIGraphicsControlPanel(remoCon: UIRemoCon?) : UICanvas() {
options.forEachIndexed { index, strings ->
val mode = strings[2]
val font = if (mode == "h1") App.fontUITitle else App.fontGame
val label = (strings[1] as () -> String).invoke()
val labelWidth = App.fontGame.getWidth(label)
val labelWidth = font.getWidth(label)
batch.color = when (mode) {
"h1" -> Toolkit.Theme.COL_MOUSE_UP
"p" -> Color.LIGHT_GRAY
@@ -180,7 +183,7 @@ class UIGraphicsControlPanel(remoCon: UIRemoCon?) : UICanvas() {
else
drawX + width/2 - panelgap - labelWidth // right aligned at the middle of the panel, offsetted by panelgap
App.fontGame.draw(batch, label, xpos.toFloat(), drawY + optionsYpos[index] - 2f)
font.draw(batch, label, xpos.toFloat(), drawY + optionsYpos[index] - 2f)
// draw hrule
if (mode == "h1") {