mirror of
https://github.com/wassname/phaser.git
synced 2026-06-27 16:10:15 +08:00
Sound.onMarkerComplete event is now dispatched when a marker stops. See Sound.onLoop for a looping marker event (thanks registered99, fixes #500)
This commit is contained in:
@@ -194,6 +194,7 @@ Bug Fixes:
|
||||
* Loader.replaceInFileList wouldn't over-write the previous entry correctly, which caused the Loader.image overwrite parameter to fail (thanks basoko, fixes #493)
|
||||
* If the game was set to NO_SCALE and you swapped orientation, it would pause and resize, then fail to resize when you swapped back (thanks starnut, fixes #258)
|
||||
* Device no longer things a Windows Phone or Windows Tablet are desktop devices (thanks wombatbuddy, fixes #506)
|
||||
* Sound.onMarkerComplete event is now dispatched when a marker stops. See Sound.onLoop for a looping marker event (thanks registered99, fixes #500)
|
||||
|
||||
|
||||
TO DO:
|
||||
|
||||
+7
-1
@@ -341,7 +341,7 @@ Phaser.Sound.prototype = {
|
||||
|
||||
if (this.currentTime >= this.durationMS)
|
||||
{
|
||||
console.log(this.currentMarker, 'has hit duration');
|
||||
// console.log(this.currentMarker, 'has hit duration');
|
||||
if (this.usingWebAudio)
|
||||
{
|
||||
if (this.loop)
|
||||
@@ -359,6 +359,7 @@ Phaser.Sound.prototype = {
|
||||
else
|
||||
{
|
||||
// console.log('loop3');
|
||||
this.onMarkerComplete.dispatch(this.currentMarker, this);
|
||||
this.play(this.currentMarker, 0, this.volume, true, true);
|
||||
}
|
||||
}
|
||||
@@ -709,6 +710,11 @@ Phaser.Sound.prototype = {
|
||||
this.isPlaying = false;
|
||||
var prevMarker = this.currentMarker;
|
||||
|
||||
if (this.currentMarker !== '')
|
||||
{
|
||||
this.onMarkerComplete.dispatch(this.currentMarker, this);
|
||||
}
|
||||
|
||||
this.currentMarker = '';
|
||||
this.onStop.dispatch(this, prevMarker);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user