eguneys Posted August 2, 2014 Share Posted August 2, 2014 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 More sharing options...
Recommended Posts