Adding marker for each key in spritemap object

This commit is contained in:
Pavle Goloskokovic 2017-11-30 18:55:21 +01:00
parent d65cf17a4d
commit 9a156ec898

View file

@ -11,6 +11,14 @@ var WebAudioSpriteSound = new Class({
* @property {object} spritemap * @property {object} spritemap
*/ */
this.spritemap = manager.game.cache.json.get(key).spritemap; this.spritemap = manager.game.cache.json.get(key).spritemap;
for (var markerName in this.spritemap) {
this.addMarker({
name: markerName,
start: this.spritemap[markerName].start,
duration: this.spritemap[markerName].end - this.spritemap[markerName].start,
config: config
});
}
} }
}); });
module.exports = WebAudioSpriteSound; module.exports = WebAudioSpriteSound;