Class uki.geometry.Rect


Extends uki.geometry.Point, uki.geometry.Size.

Defined in: geometry.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
uki.geometry.Rect(var_args)
Rectangle with x, y, width and height properties May be used as uki.geometry.Point or uki.geometry.Size - if 4 arguments given creates size with x,y,width,height set to the given arguments - if 2 number arguments given creates size with x = y = 0 and width and height set set to the given arguments - if a Point and a Size given creates rect with point as an origin and given size
Method Summary
Method Attributes Method Name and Description
 
Creates a new Rect with same properties
 
Checks if point is within this
 
Checks if this contains given rect
<static>  
uki.geometry.Rect.creates(var_args)
Creates rect from different representations - if no params given returns null - if uki.geometry.Rect given returns it - if "200 300" or "0 10 200 300" string converts it to rect - if two or four params given creates rect from them
 
Checks if this rect has non-positive width or height
 
eq(rect)
Checks if this equals to another Rect
<static>  
uki.geometry.Rect.fromCoords(minX, maxX, minY, maxY)
Creates Rect from minX, minY, maxX, maxY
<static>  
uki.geometry.Rect.fromCoordsString(string)
Creates Rect from "minX minY maxX maxY" string
<static>  
uki.geometry.Rect.fromString(string)
Creates Rect from "x y width height" or "width height" string
 
inset(dx, dy)
Insets size with dx and dy
 
Intersects this with given rect
 
maxX()
Equals to x + width
 
maxY()
Equals to y + height
 
midX()
Point between minX and maxX
 
midY()
Point between minY and maxY
 
minX()
Equals to .x
 
minY()
Equals to .y
 
Moves origin to 0,0 point
 
Moves origin point by x, y
 
Converts Rect to "x y maxX maxY" string
 
Converts Rect to "x y width height" string
 
union(rect)
Union rect of this and given rect
Class Detail
uki.geometry.Rect(var_args)
Rectangle with x, y, width and height properties May be used as uki.geometry.Point or uki.geometry.Size - if 4 arguments given creates size with x,y,width,height set to the given arguments - if 2 number arguments given creates size with x = y = 0 and width and height set set to the given arguments - if a Point and a Size given creates rect with point as an origin and given size
Parameters:
{...number|uki.geometry.Point|uki.geometry.Size} var_args
Method Detail
{uki.geometry.Size} clone()
Creates a new Rect with same properties
Returns:
{uki.geometry.Size} new Size

{boolean} containsPoint(point)
Checks if point is within this
Parameters:
{uki.geometry.Point} point
Returns:
{boolean}

{boolean} containsRect(rect)
Checks if this contains given rect
Parameters:
{uki.geometry.Rect} rect
Returns:
{boolean}

<static> {uki.geometry.Rect} uki.geometry.Rect.creates(var_args)
Creates rect from different representations - if no params given returns null - if uki.geometry.Rect given returns it - if "200 300" or "0 10 200 300" string converts it to rect - if two or four params given creates rect from them
Parameters:
{...string|number|uki.geometry.Rect} var_args
Rect representation
Returns:
{uki.geometry.Rect} created size

{boolean} empty()
Checks if this rect has non-positive width or height
Returns:
{boolean}

{boolean} eq(rect)
Checks if this equals to another Rect
Parameters:
{uki.geometry.Rect} rect
Rect to compare with
Returns:
{boolean}

<static> {uki.geometry.Rect} uki.geometry.Rect.fromCoords(minX, maxX, minY, maxY)
Creates Rect from minX, minY, maxX, maxY
Parameters:
{number} minX
{number} maxX
{number} minY
{number} maxY
Returns:
{uki.geometry.Rect}

<static> {uki.geometry.Rect} uki.geometry.Rect.fromCoordsString(string)
Creates Rect from "minX minY maxX maxY" string
Parameters:
{string} string
Returns:
{uki.geometry.Rect}

<static> {uki.geometry.Rect} uki.geometry.Rect.fromString(string)
Creates Rect from "x y width height" or "width height" string
Parameters:
{string} string
Returns:
{uki.geometry.Rect}

{uki.geometry.Rect} inset(dx, dy)
Insets size with dx and dy
Parameters:
{number} dx
{number} dy
Returns:
{uki.geometry.Rect} sefl

{uki.geometry.Rect} intersection(rect)
Intersects this with given rect
Parameters:
{uki.geometry.Rect} rect
Rect to intersect with
Returns:
{uki.geometry.Rect} intersection

{number} maxX()
Equals to x + width
Returns:
{number}

{number} maxY()
Equals to y + height
Returns:
{number}

{number} midX()
Point between minX and maxX
Returns:
{number}

{number} midY()
Point between minY and maxY
Returns:
{number}

{number} minX()
Equals to .x
Returns:
{number}

{number} minY()
Equals to .y
Returns:
{number}

{uki.geometry.Point} normalize()
Moves origin to 0,0 point
Returns:
{uki.geometry.Point} self

{uki.geometry.Rect} offset()
Moves origin point by x, y
Returns:
{uki.geometry.Rect} self

{string} toCoordsString()
Converts Rect to "x y maxX maxY" string
Returns:
{string}

{string} toString()
Converts Rect to "x y width height" string
Returns:
{string}

{uki.geometry.Rect} union(rect)
Union rect of this and given rect
Parameters:
{uki.geometry.Rect} rect
Returns:
{uki.geometry.Rect} union

Documentation generated by JsDoc Toolkit 2.3.3 on Thu Sep 02 2010 13:38:18 GMT+0400 (MSD) with uki-doc template.