Fixed small bug in Game where AUTO didn't detect the lack of WebGL properly. Tidied up Math a bit more.

This commit is contained in:
Richard Davey
2013-08-30 20:05:29 +01:00
parent 54d98944e4
commit f9aa7f7339
5 changed files with 106 additions and 28 deletions
+16 -5
View File
@@ -91,16 +91,15 @@ Phaser.Sprite = function (game, x, y, key, frame) {
*/
this._height = 0;
// if (texture.baseTexture.hasLoaded)
// {
this.updateFrame = true;
// }
this.updateFrame = true;
this.renderable = true;
this.position.x = x;
this.position.y = y;
// Replaces the PIXI.Point with a slightly more flexible one
this.scale = new Phaser.Point(1, 1);
};
Phaser.Sprite.prototype = Object.create(PIXI.Sprite.prototype);
@@ -116,6 +115,18 @@ Phaser.Sprite.prototype.update = function() {
}
Object.defineProperty(Phaser.Sprite.prototype, 'angle', {
get: function() {
return Phaser.Math.radToDeg(this.rotation);
},
set: function(value) {
this.rotation = Phaser.Math.degToRad(value);
}
});
Object.defineProperty(Phaser.Sprite.prototype, 'x', {
get: function() {