mirror of
https://github.com/jlengrand/korge-samples.git
synced 2026-03-10 08:31:18 +00:00
Add mono spaced bmpfont sample
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user