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