Jump to content

Audio Sprites


Recommended Posts

I use the tool eguneys mentions as well and then some simple code to add the markers. The sfxjson is the file generated by the tool. 

this.sfx = this.game.add.audio('sfx');this.sfxjson = this.game.cache.getJSON('sfxjson');var asm = this.sfxjson["spritemap"];for (var key in asm) {  if (asm.hasOwnProperty(key)) {    this.sfx.addMarker(key, asm[key]["start"], asm[key]["end"] - asm[key]["start"]);  }}

After that just do:

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...