From 297545c2de8c706b831a41820872295735008128 Mon Sep 17 00:00:00 2001 From: Adi Date: Tue, 3 Jan 2017 10:32:01 +0000 Subject: [PATCH] using EitherType for Polygon class --- docs.xml | 30 +++++++++------------------- haxelib.json | 4 ++-- package.json | 2 +- src/pixi/core/math/shapes/Polygon.hx | 18 ++++++++--------- 4 files changed, 20 insertions(+), 34 deletions(-) diff --git a/docs.xml b/docs.xml index e356bc96..f692bd4a 100644 --- a/docs.xml +++ b/docs.xml @@ -13958,29 +13958,17 @@ - + + + + - |Array|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.]]> - - - - - - |Array|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.]]> - + * @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. "PIXI.Polygon" diff --git a/haxelib.json b/haxelib.json index b586fe97..c090ab3e 100644 --- a/haxelib.json +++ b/haxelib.json @@ -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": "" diff --git a/package.json b/package.json index f3c9ed5c..bdd0a615 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/pixi/core/math/shapes/Polygon.hx b/src/pixi/core/math/shapes/Polygon.hx index 5bfb8544..fe064ec6 100644 --- a/src/pixi/core/math/shapes/Polygon.hx +++ b/src/pixi/core/math/shapes/Polygon.hx @@ -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|Array|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):Void {}) - function new(points:Array):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>):Void; /** * Creates a clone of this polygon