2013-09-09 16:01:59 +00:00
|
|
|
Phaser.Graphics = function (game, x, y) {
|
|
|
|
|
2013-09-22 14:21:51 +00:00
|
|
|
PIXI.Graphics.call(this);
|
2013-09-09 16:01:59 +00:00
|
|
|
|
2013-09-22 14:21:51 +00:00
|
|
|
Phaser.Sprite.call(this, game, x, y);
|
2013-09-09 16:01:59 +00:00
|
|
|
|
2013-09-12 20:54:41 +00:00
|
|
|
this.type = Phaser.GRAPHICS;
|
|
|
|
|
2013-09-09 16:01:59 +00:00
|
|
|
};
|
|
|
|
|
2013-09-22 21:55:34 +00:00
|
|
|
Phaser.Graphics.prototype = Object.create(PIXI.Graphics.prototype);
|
2013-09-09 16:01:59 +00:00
|
|
|
Phaser.Graphics.prototype.constructor = Phaser.Graphics;
|
2013-09-22 14:21:51 +00:00
|
|
|
Phaser.Graphics.prototype = Phaser.Utils.extend(true, Phaser.Graphics.prototype, Phaser.Sprite.prototype);
|
|
|
|
|
2013-09-09 16:01:59 +00:00
|
|
|
// Add our own custom methods
|
|
|
|
|
|
|
|
Object.defineProperty(Phaser.Graphics.prototype, 'angle', {
|
|
|
|
|
|
|
|
get: function() {
|
|
|
|
return Phaser.Math.radToDeg(this.rotation);
|
|
|
|
},
|
|
|
|
|
|
|
|
set: function(value) {
|
|
|
|
this.rotation = Phaser.Math.degToRad(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|