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

Commit

Permalink
Merge pull request #125 from IkonOne/dev
Browse files Browse the repository at this point in the history
Added missing Rectangle externs.
  • Loading branch information
adireddy authored May 10, 2017
2 parents 4a56172 + 6f29a38 commit d095e90
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pixi/core/display/DisplayObject.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ typedef DestroyOptions = {
* method called as well. 'options' will be passed on to those calls.
*/
?children:Bool,

/**
* {boolean} [options.texture=false] - Only used for child Sprites if options.children is set to true
* Should it destroy the texture of the child sprite
*/
?texture:Bool,

/**
* {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
* Should it destroy the base texture of the child sprite
Expand Down Expand Up @@ -61,9 +61,11 @@ extern class DisplayObject extends InteractiveTarget {
* Calculates the global position of the display object
*
* @param position {Point} The world origin to calculate from
* @param point {Point} A Point in which to store the value, optional (otherwise a new Point is created)
* @param skipUpdate {Bool} Should we skip the update transform
* @return {Point} A point object representing the position of this object
*/
function toGlobal(position:Point):Point;
function toGlobal(position:Point, ?point:Point, skipUpdate:Bool = false):Point;

/**
* Calculates the local position of the display object relative to another point
Expand Down Expand Up @@ -109,7 +111,7 @@ extern class DisplayObject extends InteractiveTarget {
/**
* Base destroy method for generic display objects
* Removes all internal references and listeners as well as removes children from the display list.
*
*
* @param {object|boolean} [options] - Options parameter. A boolean will act as if all options
* have been set to that value
* @param {boolean} [options.children=false] - if set to true, all the children will have their destroy
Expand All @@ -118,7 +120,7 @@ extern class DisplayObject extends InteractiveTarget {
* Should it destroy the texture of the child sprite
* @param {boolean} [options.baseTexture=false] - Only used for child Sprites if options.children is set to true
* Should it destroy the base texture of the child sprite
*/
*/
function destroy(?options:EitherType<Bool, DestroyOptions>):Void;

/**
Expand Down
67 changes: 67 additions & 0 deletions src/pixi/core/math/shapes/Rectangle.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,45 @@ extern class Rectangle extends Shape {
*/
function clone():Rectangle;

/**
* Copies another Rectangle to this one.
*
* @param rectangle {Rectangle} The rectangle to copy
* @return {Rectangle} Returns itself.
*/
function copy(rectangle:Rectangle):Rectangle;

/**
* Checks whether the x and y coordinates given are contained within the rectangle.
*
* @param x {Float} x coordinate of the point to test.
* @param y {Float} y coordinate of the point to test.
* @return {Bool} whether the x and y coordinates are within this Rectangle.
*/
override function contains(x:Float, y:Float):Bool;

/**
* Pads this rectangle, making it grow in all directions.
*
* @param padX {Float} The horizontal padding amount.
* @param padY {Float} The vertical padding amount.
*/
function pad(padX:Float, padY:Float):Void;

/**
* Fits this rectangle around the passed one.
*
* @param rectangle {Rectangle} The rectangle to fit.
*/
function fit(rectangle:Rectangle):Void;

/**
* Enlarges this rectangle to fit around the passed one.
*
* @param rectangle {Rectangle} The rectangle to include.
*/
function enlarge(rectangle:Rectangle):Void;

/**
* @property x
* @type Float
Expand Down Expand Up @@ -50,4 +89,32 @@ extern class Rectangle extends Shape {
* @default 0
*/
var height:Float;

/**
* @property left
* @type Float
* @default 0
*/
var left:Float;

/**
* @property right
* @type Float
* @default 0
*/
var right:Float;

/**
* @property top
* @type Float
* @default 0
*/
var top:Float;

/**
* @property bottom
* @type Float
* @default 0
*/
var bottom:Float;
}

0 comments on commit d095e90

Please sign in to comment.