Lots of renderTexture updates and examples added

This commit is contained in:
Richard Davey
2013-11-13 06:49:24 +00:00
parent e4faa34908
commit 6a24d6116b
14 changed files with 486 additions and 44 deletions
+8 -1
View File
@@ -25,6 +25,9 @@ Phaser.Graphics = function (game, x, y) {
*/
this.type = Phaser.GRAPHICS;
this.position.x = x;
this.position.y = y;
};
Phaser.Graphics.prototype = Object.create(PIXI.Graphics.prototype);
@@ -56,10 +59,14 @@ Phaser.Graphics.prototype.destroy = function() {
Phaser.Graphics.prototype.drawPolygon = function (poly) {
graphics.moveTo(poly.points[0].x, poly.points[0].y);
for (var i = 1; i < poly.points.length; i += 1) {
for (var i = 1; i < poly.points.length; i += 1)
{
graphics.lineTo(poly.points[i].x, poly.points[i].y);
}
graphics.lineTo(poly.points[0].x, poly.points[0].y);
}
Object.defineProperty(Phaser.Graphics.prototype, 'angle', {