From fbecf256a2773e3b98ef4b8b609ed6544750566e Mon Sep 17 00:00:00 2001 From: cmclark00 Date: Tue, 1 Apr 2025 23:55:09 -0400 Subject: [PATCH] Fix title text: make lowercase and correct overlapping issue --- .../com/pixelmintdrop/game/TitleScreen.kt | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/pixelmintdrop/game/TitleScreen.kt b/app/src/main/java/com/pixelmintdrop/game/TitleScreen.kt index 42ba605..55000c5 100644 --- a/app/src/main/java/com/pixelmintdrop/game/TitleScreen.kt +++ b/app/src/main/java/com/pixelmintdrop/game/TitleScreen.kt @@ -240,24 +240,30 @@ class TitleScreen @JvmOverloads constructor( // Draw title with "Mint" in mint color val titleY = height * 0.4f - val fullTitle = "Pixel Mint Drop" - val pixelWidth = titlePaint.measureText("Pixel ") - val mintWidth = titlePaint.measureText("Mint") - val dropWidth = titlePaint.measureText(" Drop") + val fullTitle = "pixel mint drop" + val pixelWidth = titlePaint.measureText("pixel ") + val mintWidth = titlePaint.measureText("mint") + val dropWidth = titlePaint.measureText(" drop") - // Draw "Pixel" in theme color - canvas.drawText("Pixel ", width / 2f - (mintWidth + dropWidth) / 2, titleY, titlePaint) + // Calculate total width + val totalWidth = pixelWidth + mintWidth + dropWidth + + // Start position for "pixel" + val startX = width / 2f - totalWidth / 2 + + // Draw "pixel" in theme color + canvas.drawText("pixel ", startX, titleY, titlePaint) // Save the original color val originalColor = titlePaint.color - // Draw "Mint" in mint color (#3EB489) + // Draw "mint" in mint color (#3EB489) titlePaint.color = Color.parseColor("#3EB489") - canvas.drawText("Mint", width / 2f - (dropWidth) / 2, titleY, titlePaint) + canvas.drawText("mint", startX + pixelWidth, titleY, titlePaint) - // Restore the original color and draw "Drop" + // Restore the original color and draw "drop" titlePaint.color = originalColor - canvas.drawText(" Drop", width / 2f + (mintWidth) / 2, titleY, titlePaint) + canvas.drawText(" drop", startX + pixelWidth + mintWidth, titleY, titlePaint) // Draw high scores using pre-allocated manager val highScores: List = highScoreManager.getHighScores()