Add mono spaced bmpfont sample

This commit is contained in:
Tobse
2020-11-07 20:50:20 +01:00
parent ee385b61cb
commit ac0fd1334f

View File

@@ -9,6 +9,7 @@ import com.soywiz.korio.file.std.*
suspend fun main() = Korge(bgcolor = Colors["#333"]) {
val font1 = resourcesVfs["font1.fnt"].readBitmapFont()
val segment7 = resourcesVfs["segment7.fnt"].readBitmapFont() // mono spaced
val text1 = text("Hello World!", textSize = 96.0, font = font1)
val text2 = text("Hello World!", textSize = 96.0, font = font1) {
filtering = false
@@ -29,4 +30,16 @@ suspend fun main() = Korge(bgcolor = Colors["#333"]) {
}
}
}
text("42:10", textSize = 64.0, font = segment7) {
val text = this
alignX(root, 0.5, true)
alignY(root, 0.75, true)
launchImmediately {
var count = 10
while (true) {
text.text = "42:${count++}"
delay(1.seconds)
}
}
}
}