font update/ime fix

This commit is contained in:
minjaesong
2023-06-06 18:15:55 +09:00
parent eb2c716691
commit 8d0d84fbf8
17 changed files with 50 additions and 41 deletions

View File

@@ -74,7 +74,7 @@ class Notification : UICanvas() {
message.forEachIndexed { index, s ->
val xoff = 6 + (displayedTextWidth - realTextWidth) / 2
val y = -textHeight + App.fontGame.lineHeight * index
App.fontGame.draw(batch, s, LRmargin + xoff, y)
App.fontGame.draw(batch, s, LRmargin + xoff, y )
}

View File

@@ -180,7 +180,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].toFloat())
App.fontGame.draw(batch, label, xpos.toFloat(), drawY + optionsYpos[index] - 2f)
// draw hrule
if (mode == "h1") {

View File

@@ -350,7 +350,7 @@ private class UIItemInputKeycap(
batch.draw(labels.get(21,2), (posX + (width - 20) / 2).toFloat(), posY + 4f)
else {
val keysymw = App.fontGame.getWidth(keysym)
App.fontGame.draw(batch, keysym, posX + (width - keysymw) / 2, posY + 4)
App.fontGame.draw(batch, keysym, posX + (width - keysymw) / 2, posY + 2)
}
}

View File

@@ -416,17 +416,17 @@ class UIItemControlPaletteBaloon(val parent: UIKeyboardControlPanel, initialX: I
// texts. Sorted in the same way as UIItemControlPaletteBaloon.iconButtons
batch.color = Color.WHITE
App.fontGame.draw(batch, Lang["GAME_ACTION_MOVE_VERB"], col0 + 72, posY + 43)
App.fontGame.draw(batch, Lang["GAME_ACTION_JUMP"], col1 + 40, posY + 43)
App.fontGame.draw(batch, Lang["GAME_ACTION_MOVE_VERB"], col0 + 72, posY + 41)
App.fontGame.draw(batch, Lang["GAME_ACTION_JUMP"], col1 + 40, posY + 41)
App.fontGame.draw(batch, Lang["GAME_INVENTORY"], col0 + 40, row1)
App.fontGame.draw(batch, Lang["GAME_CRAFTING"], col0 + 40, row2)
App.fontGame.draw(batch, Lang["GAME_ACTION_GRAPPLE"], col0 + 40, row3)
App.fontGame.draw(batch, Lang["GAME_ACTION_QUICKSEL"], col0 + 40, row4)
App.fontGame.draw(batch, Lang["GAME_INVENTORY"], col0 + 40, row1 - 2)
App.fontGame.draw(batch, Lang["GAME_CRAFTING"], col0 + 40, row2 - 2)
App.fontGame.draw(batch, Lang["GAME_ACTION_GRAPPLE"], col0 + 40, row3 - 2)
App.fontGame.draw(batch, Lang["GAME_ACTION_QUICKSEL"], col0 + 40, row4 - 2)
App.fontGame.draw(batch, Lang["GAME_ACTION_ZOOM"], col1 + 40, row1)
App.fontGame.draw(batch, Lang["MENU_LABEL_IME_TOGGLE"], col1 + 40, row2)
App.fontGame.draw(batch, Lang["MENU_LABEL_MENU"], col1 + 40, row3)
App.fontGame.draw(batch, Lang["GAME_ACTION_ZOOM"], col1 + 40, row1 - 2)
App.fontGame.draw(batch, Lang["MENU_LABEL_IME_TOGGLE"], col1 + 40, row2 - 2)
App.fontGame.draw(batch, Lang["MENU_LABEL_MENU"], col1 + 40, row3 - 2)
}

View File

@@ -636,10 +636,10 @@ class UIItemPlayerCells(
// texts
batch.color = highlightTextCol
val playTimeTextLen = App.fontGame.getWidth(totalPlayTime)
App.fontGame.draw(batch, playerName, x + 146f, y + height - 82f)
App.fontGame.draw(batch, worldName, x + 146f, y + height - 53f)
App.fontGame.draw(batch, lastPlayTime, x + 146f, y + height - 24f)
App.fontGame.draw(batch, totalPlayTime, x + width - 5f - playTimeTextLen, y + height - 24f)
App.fontGame.draw(batch, playerName, x + 146f, y + height - 84f)
App.fontGame.draw(batch, worldName, x + 146f, y + height - 55f)
App.fontGame.draw(batch, lastPlayTime, x + 146f, y + height - 26f)
App.fontGame.draw(batch, totalPlayTime, x + width - 5f - playTimeTextLen, y + height - 26f)
// icons
batch.draw(icons.get(24,0), x + 120f, y + height - 82f) // player name
batch.draw(icons.get(12,0), x + 119f, y + height - 53f) // world map
@@ -808,7 +808,7 @@ class UIItemWorldCells(
App.fontSmallNumbers.draw(batch, "${skimmer.diskFile.length().ushr(10)} KiB", x + 3f, y + height - 16f)
// savegame name
if (saveDamaged) batch.color = colourBad
App.fontGame.draw(batch, saveName, x + 3f, y + 1f)
App.fontGame.draw(batch, saveName, x + 3f, y + -1f)
super.render(batch, camera)
batch.color = Color.WHITE

View File

@@ -35,10 +35,10 @@ class UITooltip : UICanvas() {
val textMarginX = 4
override var width: Int
get() = msgWidth + (textMarginX + Toolkit.baloonTile.tileW) * 2
get() = msgWidth + (textMarginX + 36) * 2
set(value) { throw Error("You are not supposed to set the width of the tooltip manually.") }
override var height: Int
get() = Toolkit.baloonTile.tileH * 2 + font.lineHeight.toInt()
get() = 36 * 2 + font.lineHeight.toInt()
set(value) { throw Error("You are not supposed to set the height of the tooltip manually.") }
override fun renderUI(batch: SpriteBatch, camera: Camera) {

View File

@@ -387,9 +387,9 @@ class UIItemWorldCellsSimple(
// draw texts
batch.color = tcol
batch.draw(icons.get(0, 1), posX + 4f, posY + 1f)
App.fontGame.draw(batch, worldName ?: "$EMDASH", posX + 32, posY + 1)
App.fontGame.draw(batch, worldName ?: "$EMDASH", posX + 32, posY - 1)
batch.draw(icons.get(1, 1), posX + 4f, posY + 25f)
App.fontGame.draw(batch, if (worldInfo?.seed == null) "$EMDASH" else "${(if (worldInfo.seed > 0) "+" else "")}${worldInfo.seed}" , posX + 32, posY + 25)
App.fontGame.draw(batch, if (worldInfo?.seed == null) "$EMDASH" else "${(if (worldInfo.seed > 0) "+" else "")}${worldInfo.seed}" , posX + 32, posY + 23)
// text separator
batch.color = bcol.cpy().sub(0f,0f,0f,0.65f)
Toolkit.fillArea(batch, posX + 2, posY + 23, width - 4, 1)