Fresh build. Added pre/post update hooks to Graphics.

This commit is contained in:
photonstorm
2014-02-17 11:27:31 +00:00
parent d026f968de
commit 78bf874888
7 changed files with 1917 additions and 284 deletions
+4 -8
View File
@@ -531,28 +531,24 @@ Phaser.Physics.Body.prototype = {
points = Array.prototype.slice.call(arguments, 1);
var path;
var path = [];
// Did they pass in a single array of points?
if (points.length === 1 && Array.isArray(points[0]))
{
path = points[0];
path = path.concat(points[0]);
}
else if (Array.isArray(points[0]))
{
path = points;
path = path.concat(points);
}
else if (typeof points[0] === 'number')
{
var temp = [];
// We've a list of numbers
for (var i = 0, len = points.length; i < len; i += 2)
{
temp.push([points[i], points[i + 1]]);
path.push([points[i], points[i + 1]]);
}
path = temp;
}
// Now process them into p2 values