Why the text widget centerOn() method is notwoking?
-
The code:
val font = resourcesVfs["fonts/clear_sans.fnt"].readBitmapFont() text("2048", cellSize * 0.5, Colors.WHITE, font).centerOn(bgLogo)
runJvm:
Please help me to solve this problem, thanks!
-
I also noticed that centerOn stopped working (at least in some cases) after some KotGe library upgrade.
And I easily changed this to the manually calculated positioning ( position(x, y) )
E.g. in https://github.com/andstatus/game2048/blob/master/src/commonMain/kotlin/org/andstatus/game2048/presenter/Block.kt I changed:centerOn(this@graphics)
to
position(cellSize / 2, cellSize / 2)