korge
korge copied to clipboard
readSound.play have issues in JVM windows while readMusic seems to work fine
Related discussion: https://github.com/korlibs/korge/discussions/2043
class MyScene : Scene() {
private var clickSound : Sound? = null
override suspend fun SContainer.sceneInit() {
clickSound = resourcesVfs["click.mp3"].readSound()
}
override suspend fun SContainer.sceneMain() {
uiVerticalStack {
uiButton("New game").onClick {
clickSound?.play()
}
}.centerOnStage()
}
}