mirror of
https://github.com/cmclark00/mintris.git
synced 2025-05-17 23:55:21 +01:00
Fix title text: make lowercase and correct overlapping issue
This commit is contained in:
parent
ff1a0edd2f
commit
fbecf256a2
1 changed files with 16 additions and 10 deletions
|
@ -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<HighScore> = highScoreManager.getHighScores()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue