2048游戏教程显示
text("0", cellSize * 0.5, Colors.WHITE, font) {
setTextBounds(Rectangle(0.0, 0.0, bgScore.width, cellSize - 24.0))
format = format.copy(align = Html.Alignment.MIDDLE_CENTER) // there is an error
centerXOn(bgScore)
alignTopToTopOf(bgScore, 12.0)
}我使用AndroidStudio4.1和Korge插件1.12.2.2。IDE显示:未解析引用.
我把这一行改为
setFormat(align = TextAlignment.MIDDLE_CENTER)IDE的错误消失了,但是文本也没有显示。
如何修复它,并将文本设置在bgScore对象的中间。
非常感谢
发布于 2020-12-14 02:20:28
新版本的korge
text("0", cellSize * 0.5, Colors.WHITE, font) {
setTextBounds(Rectangle(0.0, 0.0, bgScore.width, cellSize - 24.0))
// format = format.copy(align = Html.Alignment.MIDDLE_CENTER) // there is an error
alignment = TextAlignment.MIDDLE_CENTER // it works in version korGE 2.0
centerXOn(bgScore)
alignTopToTopOf(bgScore, 12.0)
}https://stackoverflow.com/questions/65274435
复制相似问题