battery complication not using shaperenderer

This commit is contained in:
minjaesong
2024-07-19 01:30:38 +09:00
parent d7f6e253d4
commit 57b3d355ae
4 changed files with 13 additions and 19 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -412,12 +412,17 @@ object TerrarumPostProcessor : Disposable {
val watchStr = "$clockH:$clockM"
val batteryPercentageStr = "$batteryPercentage%"
val percIndex = (batteryPercentage.toFloat() * 0.01 * 64).toInt() // 0-63
val btx = percIndex % 4
val bty = percIndex / 4
val btxoff = isCharging.toInt() * 4
batch.inUse {
batch.color = Color.WHITE
App.fontSmallNumbers.draw(batch, watchStr, wx, wy)
if (hasBattery) {
val batCell = batteryTex.get(0, isCharging.toInt())
val batCell = batteryTex.get(btxoff + btx, bty)
batch.draw(batCell, wx - watchHeight - batCell.regionWidth, wy)
App.fontSmallNumbers.draw(
@@ -427,20 +432,6 @@ object TerrarumPostProcessor : Disposable {
)
}
}
val magn = App.scr.magn
shapeRenderer.inUse(ShapeRenderer.ShapeType.Filled) {
if (hasBattery && !isCharging) {
val w = magn * (16f * batteryPercentage / 100f)
val h = magn * 6f
val x = magn * (wx - watchHeight - batteryTex.tileW + 2)
val y = magn * (wy + 3)
shapeRenderer.color = Color(1f, 1f, 1f, 1f)
shapeRenderer.rect(x, y, w, h)
}
}
}
private val defaultResStr = "Ingame UI Area"

Binary file not shown.