Time.reset does a removeAll on any Timers.

Device no longer things a Windows Phone or Windows Tablet are desktop devices (thanks wombatbuddy, fixes #506)
This commit is contained in:
photonstorm 2014-03-02 10:56:39 +00:00
parent 664d5b3e2c
commit 7ff4e51ab1
3 changed files with 23 additions and 1 deletions

View file

@ -131,6 +131,7 @@ New features:
* Group.sendToBottom(child) is the handy opposite of Group.bringToTop() * Group.sendToBottom(child) is the handy opposite of Group.bringToTop()
* Group.moveUp(child) will move a child up the display list, swapping with the child above it. * Group.moveUp(child) will move a child up the display list, swapping with the child above it.
* Group.moveDown(child) will move a child down the display list, swapping with the child below it. * Group.moveDown(child) will move a child down the display list, swapping with the child below it.
* Device.windowsPhone is now tested for.
Updates: Updates:
@ -192,6 +193,7 @@ Bug Fixes:
* Calling destroy while in an Input Event callback now works for either the parent Group or the calling object itself. * Calling destroy while in an Input Event callback now works for either the parent Group or the calling object itself.
* Loader.replaceInFileList wouldn't over-write the previous entry correctly, which caused the Loader.image overwrite parameter to fail (thanks basoko, fixes #493) * 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) * 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)
TO DO: TO DO:

View file

@ -81,6 +81,12 @@ Phaser.Device = function (game) {
*/ */
this.windows = false; this.windows = false;
/**
* @property {boolean} windowsPhone - Is running on a Windows Phone?
* @default
*/
this.windowsPhone = false;
// Features // Features
/** /**
@ -398,6 +404,11 @@ Phaser.Device.prototype = {
else if (/Windows/.test(ua)) else if (/Windows/.test(ua))
{ {
this.windows = true; this.windows = true;
if (/Windows Phone/i.test(ua))
{
this.windowsPhone = true;
}
} }
if (this.windows || this.macOS || (this.linux && this.silk === false)) if (this.windows || this.macOS || (this.linux && this.silk === false))
@ -405,6 +416,12 @@ Phaser.Device.prototype = {
this.desktop = true; this.desktop = true;
} }
// Windows Phone / Table reset
if (this.windowsPhone || ((/Windows NT/i.test(ua)) && (/Touch/i.test(ua))))
{
this.desktop = false;
}
}, },
/** /**

View file

@ -362,12 +362,15 @@ Phaser.Time.prototype = {
}, },
/** /**
* Resets the private _started value to now. * Resets the private _started value to now and removes all currently running Timers.
* *
* @method Phaser.Time#reset * @method Phaser.Time#reset
*/ */
reset: function () { reset: function () {
this._started = this.now; this._started = this.now;
this.removeAll();
} }
}; };