doodle.geom.createRectangle
Description:
- Rectangle (x:number, y:number, width:number, height:number) :Rectangle
-
Inherits
- Object
Parameters
- x:number – [optional]
- y:number – [optional]
- width:number – [optional]
- height:number – [optional]
Returns
- Rectangle –
Throws
- TypeError –
- SyntaxError –
Properties
- bottom :number
-
Returns
- number –
Throws
- TypeError –
- height :number
-
Returns
- number –
Throws
- TypeError –
- left :number
-
Returns
- number –
Throws
- TypeError –
- right :number
-
Returns
- number –
Throws
- TypeError –
- top :number
-
Returns
- number –
Throws
- TypeError –
- width :number
-
Returns
- number –
Throws
- TypeError –
- x :number
-
Returns
- number –
Throws
- TypeError –
- y :number
-
Returns
- number –
Throws
- TypeError –
Methods
- union (rect:Rectangle) :Rectangle
-
Adds two rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two.
Parameters
- rect:Rectangle –
Returns
- Rectangle –
Throws
- TypeError –
- offset (dx:number, dy:number) :Rectangle
-
Adjusts the location of the rectangle, as determined by its top-left corner, by the specified amounts.
Parameters
- dx:number –
- dy:number –
Returns
- Rectangle –
Throws
- TypeError –
- isEmpty () :boolean
-
Determines whether or not this Rectangle object is empty.
Returns
- boolean –
- intersects (rect:Rectangle) :boolean
-
Determines whether the rectangle argument intersects with this rectangle.
Parameters
- rect:Rectangle –
Returns
- boolean –
Throws
- TypeError –
- containsRect (rect:Rectangle) :boolean
-
Determines whether the rectangle argument is contained within this rectangle.
Parameters
- rect:Rectangle –
Returns
- boolean –
Throws
- TypeError –
- equals (rect:Rectangle) :boolean
-
Determines whether the rectangle argument is equal to this rectangle.
Parameters
- rect:Rectangle –
Returns
- boolean –
Throws
- TypeError –
- contains (x:number, y:number) :boolean
-
Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.
Parameters
- x:number –
- y:number –
Returns
- boolean –
Throws
- TypeError –
- containsPoint (pt:Point) :boolean
-
Determines whether the specified point is contained within this rectangle object.
Parameters
- pt:Point –
Returns
- boolean –
Throws
- TypeError –
- intersection (rect:Rectangle) :Rectangle
-
If the rectangle argument intersects with this rectangle, returns the area of intersection as a Rectangle object. If the rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0.
Parameters
- rect:Rectangle –
Returns
- Rectangle –
Throws
- TypeError –
- inflate (dx:number, dy:number) :Rectangle
-
Increases the size of the rectangle by the specified amounts, in pixels. The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.
Parameters
- dx:number –
- dy:number –
Returns
- Rectangle –
Throws
- TypeError –
- clone () :Rectangle
-
Returns
- Rectangle –
- id () :string
-
Returns
- string –
- toArray () :Array
-
Returns
- Array –
- toString () :string
-
Returns
- string –
- compose (x:number, y:number, w:number, h:number) :Rectangle
-
Sets this rectangle's parameters.
Parameters
- x:number –
- y:number –
- w:number –
- h:number –
Returns
- Rectangle –
Throws
- TypeError –
Class Functions
- isRect (rect:Rectangle) :boolean
-
Check if a given object contains a numeric rectangle properties including x, y, width, height, top, bottom, right, left. Does not check if a rectangle is actually a doodle.geom.rectangle.
Parameters
- rect:Rectangle – Object with numeric rectangle parameters.
Returns
- boolean –