mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 07:01:20 +00:00
Added Graphics.fillPoint, fillPointShape and lineBetween methods.
This commit is contained in:
parent
709819d601
commit
47e6cff967
1 changed files with 28 additions and 0 deletions
|
@ -195,6 +195,23 @@ var Graphics = new Class({
|
|||
return this;
|
||||
},
|
||||
|
||||
// POINT
|
||||
|
||||
fillPointShape: function (point, size)
|
||||
{
|
||||
return this.fillPoint(point.x, point.y, size);
|
||||
},
|
||||
|
||||
fillPoint: function (x, y, size)
|
||||
{
|
||||
this.commandBuffer.push(
|
||||
Commands.FILL_RECT,
|
||||
x, y, size, size
|
||||
);
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
// TRIANGLE
|
||||
|
||||
fillTriangleShape: function (triangle)
|
||||
|
@ -236,6 +253,17 @@ var Graphics = new Class({
|
|||
return this.lineTo(line.x2, line.y2);
|
||||
},
|
||||
|
||||
lineBetween: function (x1, y1, x2, y2)
|
||||
{
|
||||
this.beginPath();
|
||||
this.moveTo(x1, y1);
|
||||
this.lineTo(x2, y2);
|
||||
this.strokePath();
|
||||
this.closePath();
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
lineTo: function (x, y)
|
||||
{
|
||||
this.commandBuffer.push(
|
||||
|
|
Loading…
Reference in a new issue