Skip to content

Commit 13f752b

Browse files
Implemented global playAudioSprite method to enable playing audiosprite sprites on the fly
1 parent 6a64693 commit 13f752b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

v3/src/sound/BaseSoundManager.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ var BaseSoundManager = new Class({
129129
sound.play();
130130
}
131131
},
132-
playAudioSprite: NOOP,
132+
playAudioSprite: function (key, spriteName, config) {
133+
var sound = this.addAudioSprite(key);
134+
sound.events.once('SOUND_ENDED', sound.destroy.bind(sound));
135+
sound.play(spriteName, config);
136+
},
133137
remove: NOOP,
134138
removeByKey: NOOP,
135139
pauseAll: NOOP,

0 commit comments

Comments
 (0)