Skip to content
This repository has been archived by the owner on Feb 23, 2023. It is now read-only.

Commit

Permalink
using EitherType for Polygon class
Browse files Browse the repository at this point in the history
  • Loading branch information
adireddy committed Jan 3, 2017
1 parent 2df182b commit 297545c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 34 deletions.
30 changes: 9 additions & 21 deletions docs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13958,29 +13958,17 @@
</points>
<new public="1" set="method">
<f a="points">
<c path="Array"><c path="pixi.core.math.Point"/></c>
<x path="haxe.extern.EitherType">
<c path="Array"><c path="pixi.core.math.Point"/></c>
<c path="Array"><x path="Float"/></c>
</x>
<x path="Void"/>
</f>
<haxe_doc><![CDATA[* @class Polygon
* @constructor
* @param points* {Array<Point>|Array<Number>|Point...|Number...} This can be an array of Points that form the polygon,
* a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be
* all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the
* arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are
* Numbers.]]></haxe_doc>
<overloads><new public="1" set="method">
<f a="points">
<c path="Array"><x path="Float"/></c>
<x path="Void"/>
</f>
<haxe_doc><![CDATA[* @class Polygon
* @constructor
* @param points* {Array<Point>|Array<Number>|Point...|Number...} This can be an array of Points that form the polygon,
* a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be
* all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the
* arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are
* Numbers.]]></haxe_doc>
</new></overloads>
<haxe_doc>* @param {PIXI.Point[]|number[]} points - This can be an array of Points
* that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or
* the arguments passed can be all the points of the polygon e.g.
* `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat
* x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.</haxe_doc>
</new>
<meta><m n=":native"><e>"PIXI.Polygon"</e></m></meta>
</class>
Expand Down
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"contributors": [
"adireddy"
],
"releasenote": "added AccessibilityManager properties in DisplayObject",
"version": "4.2.4",
"releasenote": "minor update",
"version": "4.2.5",
"url": "https://github.com/pixijs/pixi-haxe",
"dependencies": {
"perf.js": ""
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pixijs",
"version": "4.2.4",
"version": "4.2.5",
"description": "Externs of pixi.js v4.x for Haxe - a fast and lightweight 2D rendering library that works across all devices",
"author": "Adi Reddy Mora",
"homepage": "http://adireddy.github.io",
Expand Down
18 changes: 8 additions & 10 deletions src/pixi/core/math/shapes/Polygon.hx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package pixi.core.math.shapes;

import haxe.extern.EitherType;
@:native("PIXI.Polygon")
extern class Polygon {

/**
* @class Polygon
* @constructor
* @param points* {Array<Point>|Array<Number>|Point...|Number...} This can be an array of Points that form the polygon,
* a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be
* all the points of the polygon e.g. `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the
* arguments passed can be flat x,y values e.g. `new PIXI.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are
* Numbers.
*/
@:overload(function(points:Array<Float>):Void {})
function new(points:Array<Point>):Void;
* @param {PIXI.Point[]|number[]} points - This can be an array of Points
* that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or
* the arguments passed can be all the points of the polygon e.g.
* `new PIXI.Polygon(new PIXI.Point(), new PIXI.Point(), ...)`, or the arguments passed can be flat
* x,y values e.g. `new Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are Numbers.
*/
function new(points:EitherType<Array<Point>, Array<Float>>):Void;

/**
* Creates a clone of this polygon
Expand Down

0 comments on commit 297545c

Please sign in to comment.