Commit graph

23 commits

Author SHA1 Message Date
photonstorm
f15fe6706c All undefined argument checks were changed from if (typeof x === 'undefined') to if (x === undefined) removing the typeof check and saving some bytes across the codebase in the process. 2015-07-22 10:37:15 +01:00
photonstorm
a69e53f901 Copyright date change. 2015-02-25 03:36:23 +00:00
photonstorm
819826ce08 Added Polygon.flatten and Polygon.toNumberArray.
Fixed Graphics.lineTo if no moveTo has been specified.
Fixed Graphics.drawShape if a mixed-type Polygon has been given.
2015-02-17 18:03:15 +00:00
photonstorm
e100f2f528 Added in type properties. 2015-02-17 16:38:07 +00:00
photonstorm
98993365d4 Small refactor to pass jshint. 2014-10-29 07:46:56 +00:00
photonstorm
ce32d492af Phaser.Polygon has been refactored to address some Pixi v2 migration issues (thanks @pnstickne for the original implementation #1267)
Polygon.area is now only calculated when the Polygon points list is modified, rather than on every call.

Phaser.Polygon can now accept the points list in a variety of formats: Arrays of Points, numbers, objects with public x/y properties or any combination of, or as a parameter list (thanks @pnstickne for the original implementation #1267)

Polygon.contains now correctly calculates the result  (thanks @pnstickne @BurnedToast #1267)
2014-10-29 07:46:56 +00:00
Sebastian Bombitzky
1e3c7cfee7 Fixed return value of Polygon.contains
Polygon.contains was toggling the return value on each valid hit.
2014-10-28 14:04:33 +01:00
photonstorm
e14c6efbc3 Updated to support new Pixi style of points. 2014-10-22 23:52:46 +01:00
photonstorm
ac27f12c95 Fixes for Pixi update WebGL UV calls. 2014-10-11 04:18:42 +01:00
photonstorm
20551f9129 Lots of jsdocs fixes ready for the new doc generator. 2014-09-16 17:35:08 +01:00
beeglebug
bfd0b77fd4 typo 2014-08-21 22:50:09 +01:00
beeglebug
c85f4c04b0 may as well use the setter logic, saves duplicating code 2014-08-21 22:46:44 +01:00
beeglebug
2faab9b516 added clone and setTo functions 2014-08-21 22:45:10 +01:00
photonstorm
b2c68c1369 Graphics.drawTriangles will draw an array of vertices to the Graphics object (thanks @codevinsky, #795)
Polygon.area will calculate the area of the Polygon (thanks @codevinsky, #795)
2014-05-14 00:04:31 +01:00
jdowell
f10c772ff3 Graphics.drawTriangles && Polygon.area
Demo:
http://phaser-triangles.herokuapp.com
2014-05-02 12:30:49 -05:00
photonstorm
7a64f53006 Fixed Polygon.contains for coordinates to the left of the polygon (thanks @vilcans, fix #766) 2014-04-27 09:56:29 +01:00
Christian Wesselhoeft
61f18b675c Trim trailing whitespace. 2014-03-25 14:56:04 -07:00
photonstorm
d44775c095 Phaser.Ellipse added. A fully compatible port of the PIXI.Ellipse class, can be used in Sprite/Image hitArea tests.
Phaser.Polygon added. A fully compatible port of the PIXI.Polygon class, can be used in Sprite/Image hitArea tests.
2014-02-10 01:37:50 +00:00
photonstorm
0896c2fac7 Updating copyright year and README. 2014-02-05 16:54:59 +00:00
photonstorm
13a2cc2feb Updating all files to adhere to the JSHint settings and fixing lots of documentation errors on the way. 2013-11-25 03:13:04 +00:00
photonstorm
3f99b691c9 Added in a Group.sort demo, also updated the documentation and build files. 2013-11-07 06:10:15 +00:00
Román Jiménez
35dd98c72f Added some docstring to the Polygon class 2013-11-05 20:31:33 +01:00
Román Jiménez
06e33bc8e4 Polygon & drawPolygon method 2013-11-05 20:25:06 +01:00