Input Handler updates, orientation screen and World visibility

This commit is contained in:
photonstorm
2013-11-04 20:43:59 +00:00
parent 19ddad8095
commit 2e576fa9a7
8 changed files with 236 additions and 64 deletions
+20
View File
@@ -169,6 +169,13 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
*/
this.freezeFrames = false;
/**
* When the Button is clicked you can optionally force the state to "out".
* @property {boolean} forceOut
* @default
*/
this.forceOut = true;
this.setFrames(overFrame, outFrame, downFrame);
if (callback !== null)
@@ -513,8 +520,21 @@ Phaser.Button.prototype.onInputUpHandler = function (pointer) {
this.onUpSound.play(this.onUpSoundMarker);
}
if (this.forceOut && this.freezeFrames == false)
{
if (this._onOutFrameName != null)
{
this.frameName = this._onOutFrameName;
}
else if (this._onOutFrameID != null)
{
this.frame = this._onOutFrameID;
}
}
if (this.onInputUp)
{
this.onInputUp.dispatch(this, pointer);
}
};