mirror of
https://github.com/wassname/phaser.git
synced 2026-07-15 01:11:26 +08:00
Polygon & drawPolygon method
This commit is contained in:
@@ -50,6 +50,18 @@ Phaser.Graphics.prototype.destroy = function() {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled
|
||||
*/
|
||||
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) {
|
||||
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', {
|
||||
|
||||
get: function() {
|
||||
|
||||
Reference in New Issue
Block a user