korge icon indicating copy to clipboard operation
korge copied to clipboard

readSound.play have issues in JVM windows while readMusic seems to work fine

Open soywiz opened this issue 1 year ago • 0 comments

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()
   }
}

soywiz avatar Dec 31 '23 08:12 soywiz