shadow backing on the fullscr bat and clocks

This commit is contained in:
minjaesong
2024-07-19 02:21:45 +09:00
parent 57b3d355ae
commit 3d1d38dc60
3 changed files with 42 additions and 3 deletions

Binary file not shown.

View File

@@ -390,9 +390,9 @@ object TerrarumPostProcessor : Disposable {
val battStatus = GetBatteryStatus.get()
hasBattery = battStatus.hasBattery
isCharging = battStatus.isCharging
batteryPercentage = battStatus.percentage
hasBattery = true//battStatus.hasBattery
isCharging = true//battStatus.isCharging
batteryPercentage = 85//battStatus.percentage
}
private var clockH = "00"
@@ -401,6 +401,8 @@ object TerrarumPostProcessor : Disposable {
private var isCharging = false
private var batteryPercentage = 0
private val shadowCol = Color(1f, 1f, 1f, 0.6666667f)
private fun drawFullscreenComplications() {
val tvSafeArea2H = App.scr.tvSafeActionHeight.toFloat()
val dockHeight = tvSafeArea2H
@@ -418,6 +420,18 @@ object TerrarumPostProcessor : Disposable {
val btxoff = isCharging.toInt() * 4
batch.inUse {
// draw blur backs
batch.color = shadowCol
Toolkit.drawBlurShadowBack(batch, wx, wy + 2, App.fontSmallNumbers.getWidth(watchStr).toFloat(), 9f)
if (hasBattery) {
Toolkit.drawBlurShadowBack(batch, wx - watchHeight - batteryTex.tileW - App.fontSmallNumbers.getWidth(batteryPercentageStr) - 4, wy + 2, App.fontSmallNumbers.getWidth(batteryPercentageStr) + 28f, 9f)
}
// draw texts
batch.color = Color.WHITE
App.fontSmallNumbers.draw(batch, watchStr, wx, wy)

View File

@@ -59,6 +59,7 @@ object Toolkit : Disposable {
private lateinit var blurWriteQuad4: Mesh
// val baloonTile = TextureRegionPack("assets/graphics/gui/message_black_tileable.tga", 36, 36)
val shadowTile = TextureRegionPack("assets/graphics/gui/blur_shadow.tga", 32, 32)
val textureWhiteSquare = Texture(Gdx.files.internal("assets/graphics/ortho_line_tex_2px.tga"))
val textureWhiteCircle = Texture(Gdx.files.internal("assets/graphics/circle_512.tga"))
@@ -312,6 +313,27 @@ object Toolkit : Disposable {
drawBoxBorder(batch, x - 4, y - 4, w + 8, h + 8)
}
fun drawBlurShadowBack(batch: SpriteBatch, x: Float, y: Float, w: Float, h: Float) {
val x = x - 2
val y = y + 4
val w = w + 4
// centre area
batch.draw(shadowTile.get(1, 1), x, y, w, h)
// edges
batch.draw(shadowTile.get(1, 0), x, y - shadowTile.tileH, w, shadowTile.tileH.toFloat())
batch.draw(shadowTile.get(1, 2), x, y + h, w, shadowTile.tileH.toFloat())
batch.draw(shadowTile.get(0, 1), x - shadowTile.tileW, y, shadowTile.tileW.toFloat(), h)
batch.draw(shadowTile.get(2, 1), x + w, y, shadowTile.tileW.toFloat(), h)
// corners
batch.draw(shadowTile.get(0, 0), x - shadowTile.tileW, y - shadowTile.tileH)
batch.draw(shadowTile.get(2, 0), x + w, y - shadowTile.tileH)
batch.draw(shadowTile.get(2, 2), x + w, y + h)
batch.draw(shadowTile.get(0, 2), x - shadowTile.tileW, y + h)
}
private var init = false
/**