Jump to content

How to add markers to audio spritesheet


eguneys
 Share

Recommended Posts

I have an audio spritesheet and I add markers to the audio to play the audio in the spritesheet.

        parseAudioSprite: function() {            var fx = this.game.add.audio('sfx');            var audiosprite = this.game.cache.getJSON('audiosprite');            for (var sprite in audiosprite.spritemap) {                var start = audiosprite.spritemap[sprite].start;                var end = audiosprite.spritemap[sprite].end;                var loop = audiosprite.spritemap[sprite].loop;                fx.addMarker(sprite, start, end - start);            }        }

Now i do this in one state, but i can't access this audio in other states. Do i have to set markers in every state? Can I just add markers once and use everywhere? What is the proper use of audio spritesheets?

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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