mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-18 15:32:35 +00:00
Reduice font size
This commit is contained in:
parent
56c0f7bfaf
commit
a4d4835a89
1 changed files with 4 additions and 4 deletions
|
@ -41,8 +41,8 @@ class TargetTapLoaderView @JvmOverloads constructor(
|
||||||
private val particles = mutableListOf<Particle>()
|
private val particles = mutableListOf<Particle>()
|
||||||
|
|
||||||
private val textPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
private val textPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||||
color = Color.WHITE
|
color = Color.argb(0.7f, 1f, 1f, 1f)
|
||||||
textSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 18f, resources.displayMetrics)
|
textSize = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 12f, resources.displayMetrics)
|
||||||
textAlign = Paint.Align.LEFT
|
textAlign = Paint.Align.LEFT
|
||||||
setShadowLayer(4f, 0f, 0f, Color.BLACK)
|
setShadowLayer(4f, 0f, 0f, Color.BLACK)
|
||||||
typeface = Typeface.DEFAULT_BOLD
|
typeface = Typeface.DEFAULT_BOLD
|
||||||
|
@ -236,8 +236,8 @@ class TargetTapLoaderView @JvmOverloads constructor(
|
||||||
|
|
||||||
if (isPlaying) {
|
if (isPlaying) {
|
||||||
val margin = 24f
|
val margin = 24f
|
||||||
val scoreTxt = "Score $score"
|
val scoreTxt = "Score: $score"
|
||||||
val speedTxt = "Speed ${"%.2f".format(spawnRate)}/s"
|
val speedTxt = "Speed: ${"%.2f".format(spawnRate)}/s"
|
||||||
val maxWidth = width - margin
|
val maxWidth = width - margin
|
||||||
val needRight = max(textPaint.measureText(scoreTxt), textPaint.measureText(speedTxt)) > maxWidth
|
val needRight = max(textPaint.measureText(scoreTxt), textPaint.measureText(speedTxt)) > maxWidth
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue