Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Audio Sprites


enriqueto
 Share

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:

this.sfx.play('somemarker');
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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