mirror of
https://github.com/wassname/phaser.git
synced 2026-07-15 01:11:26 +08:00
PixiPatch and other 1.0.7 features
This commit is contained in:
@@ -55,7 +55,7 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame,
|
||||
this.onInputUp.add(callback, callbackContext);
|
||||
}
|
||||
|
||||
this.input.start(0, false, true);
|
||||
this.input.start(0, true);
|
||||
|
||||
// Redirect the input events to here so we can handle animation updates, etc
|
||||
this.events.onInputOver.add(this.onInputOverHandler, this);
|
||||
|
||||
@@ -255,7 +255,7 @@ Phaser.Sprite.prototype.preUpdate = function() {
|
||||
}
|
||||
|
||||
// Frame updated?
|
||||
if (this.currentFrame.uuid != this._cache.frameID)
|
||||
if (this.currentFrame && this.currentFrame.uuid != this._cache.frameID)
|
||||
{
|
||||
this._cache.frameWidth = this.texture.frame.width;
|
||||
this._cache.frameHeight = this.texture.frame.height;
|
||||
@@ -263,7 +263,7 @@ Phaser.Sprite.prototype.preUpdate = function() {
|
||||
this._cache.dirty = true;
|
||||
}
|
||||
|
||||
if (this._cache.dirty)
|
||||
if (this._cache.dirty && this.currentFrame)
|
||||
{
|
||||
this._cache.width = Math.floor(this.currentFrame.sourceSizeW * this._cache.scaleX);
|
||||
this._cache.height = Math.floor(this.currentFrame.sourceSizeH * this._cache.scaleY);
|
||||
|
||||
@@ -94,7 +94,7 @@ Object.defineProperty(Phaser.Text.prototype, 'angle', {
|
||||
|
||||
});
|
||||
|
||||
Object.defineProperty(Phaser.Text.prototype, 'text', {
|
||||
Object.defineProperty(Phaser.Text.prototype, 'content', {
|
||||
|
||||
get: function() {
|
||||
return this._text;
|
||||
@@ -106,14 +106,14 @@ Object.defineProperty(Phaser.Text.prototype, 'text', {
|
||||
if (value !== this._text)
|
||||
{
|
||||
this._text = value;
|
||||
this.dirty = true;
|
||||
this.setText(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Object.defineProperty(Phaser.Text.prototype, 'style', {
|
||||
Object.defineProperty(Phaser.Text.prototype, 'font', {
|
||||
|
||||
get: function() {
|
||||
return this._style;
|
||||
@@ -125,7 +125,7 @@ Object.defineProperty(Phaser.Text.prototype, 'style', {
|
||||
if (value !== this._style)
|
||||
{
|
||||
this._style = value;
|
||||
this.dirty = true;
|
||||
this.setStyle(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user