phaser/src/gameobjects/Graphics.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

2013-10-01 12:54:29 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2013 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
* @module Phaser.Graphics
*/
/**
* Description.
*
* @class Phaser.Graphics
* @constructor
*
* @param {Phaser.Game} game Current game instance.
* @param {number} [x] X position of Description.
* @param {number} [y] Y position of Description.
*/
Phaser.Graphics = function (game, x, y) {
2013-09-22 14:21:51 +00:00
PIXI.Graphics.call(this);
2013-10-01 12:54:29 +00:00
/**
* @property {Description} type - Description.
*/
this.type = Phaser.GRAPHICS;
};
2013-09-22 21:55:34 +00:00
Phaser.Graphics.prototype = Object.create(PIXI.Graphics.prototype);
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);
// 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);
}
});