mirror of
https://github.com/wassname/phaser.git
synced 2026-09-11 12:31:29 +08:00
* Fixed small bug stopping Tween.pause / resume from resuming correctly when called directly.
* Fixed an issue where Tweens.removeAll wasn't clearing tweens in the addition queue. * Change: When you swap State all active tweens are now purged.
This commit is contained in:
+25
-3
@@ -172,6 +172,7 @@ Phaser.Sound.prototype = {
|
||||
|
||||
// start and stop are in SECONDS.MS (2.5 = 2500ms, 0.5 = 500ms, etc)
|
||||
// volume is between 0 and 1
|
||||
/*
|
||||
addMarker: function (name, start, stop, volume, loop) {
|
||||
|
||||
volume = volume || 1;
|
||||
@@ -186,6 +187,25 @@ Phaser.Sound.prototype = {
|
||||
loop: loop
|
||||
};
|
||||
|
||||
},
|
||||
*/
|
||||
|
||||
// start and stop are in SECONDS.MS (2.5 = 2500ms, 0.5 = 500ms, etc)
|
||||
// volume is between 0 and 1
|
||||
addMarker: function (name, start, duration, volume, loop) {
|
||||
|
||||
volume = volume || 1;
|
||||
if (typeof loop == 'undefined') { loop = false; }
|
||||
|
||||
this.markers[name] = {
|
||||
name: name,
|
||||
start: start,
|
||||
stop: start + duration,
|
||||
volume: volume,
|
||||
duration: duration,
|
||||
loop: loop
|
||||
};
|
||||
|
||||
},
|
||||
|
||||
removeMarker: function (name) {
|
||||
@@ -266,9 +286,9 @@ Phaser.Sound.prototype = {
|
||||
position = position || 0;
|
||||
volume = volume || 1;
|
||||
if (typeof loop == 'undefined') { loop = false; }
|
||||
if (typeof forceRestart == 'undefined') { forceRestart = false; }
|
||||
if (typeof forceRestart == 'undefined') { forceRestart = true; }
|
||||
|
||||
// console.log(this.name + ' play ' + marker + ' position ' + position + ' volume ' + volume + ' loop ' + loop);
|
||||
console.log(this.name + ' play ' + marker + ' position ' + position + ' volume ' + volume + ' loop ' + loop, 'force', forceRestart);
|
||||
|
||||
if (this.isPlaying == true && forceRestart == false && this.override == false)
|
||||
{
|
||||
@@ -307,7 +327,7 @@ Phaser.Sound.prototype = {
|
||||
this.loop = this.markers[marker].loop;
|
||||
this.duration = this.markers[marker].duration * 1000;
|
||||
|
||||
// console.log('marker info loaded', this.loop, this.duration);
|
||||
console.log('marker info loaded', this.loop, this.duration);
|
||||
this._tempMarker = marker;
|
||||
this._tempPosition = this.position;
|
||||
this._tempVolume = this.volume;
|
||||
@@ -315,6 +335,8 @@ Phaser.Sound.prototype = {
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('no marker info loaded');
|
||||
|
||||
this.position = position;
|
||||
this.volume = volume;
|
||||
this.loop = loop;
|
||||
|
||||
@@ -293,8 +293,6 @@ Phaser.SoundManager.prototype = {
|
||||
volume = volume || 1;
|
||||
if (typeof loop == 'undefined') { loop = false; }
|
||||
|
||||
|
||||
|
||||
var sound = new Phaser.Sound(this.game, key, volume, loop);
|
||||
|
||||
this._sounds.push(sound);
|
||||
|
||||
Reference in New Issue
Block a user