Created
January 3, 2022 16:40
-
-
Save IvanShafran/8d2b20a572e9f82498b80fff49c17447 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val scorePaint = Paint(Paint.ANTI_ALIAS_FLAG).apply { | |
color = Color.GREEN | |
textSize = context.resources.getDimension(R.dimen.score_size) | |
} | |
private var score: Int = 0 | |
private var scorePoint = PointF() | |
private fun initializeScore() { | |
val bounds = Rect() | |
scorePaint.getTextBounds("0", 0, 1, bounds) | |
val scoreMargin = resources.getDimension(R.dimen.score_margin) | |
scorePoint = PointF(width / 2f, scoreMargin + bounds.height()) | |
score = 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment