All Bundles
Position
Shape position
Operations
New
Creates a new rectangle with given size
New(rect:Rect)
Parameters
Name | Type | Description |
---|
rect | Rect | position |
Creates a new rectangle with given position and size
New(x:Int, y:Int, w:Int, h:Int)
Parameters
Name | Type | Description |
---|
x | Int | x-position |
y | Int | y-position |
w | Int | width |
h | Int | height |
Creates a new rectangle with given size
New(w:Int, h:Int)
Parameters
Name | Type | Description |
---|
w | Int | width |
h | Int | height |
AddX
Increments the current x-position
method : public : AddX(x:Int) ~ Nil
Parameters
Name | Type | Description |
---|
x | Int | increment to the current x-position |
AddY
Increments the current y-position
method : public : AddY(y:Int) ~ Nil
Parameters
Name | Type | Description |
---|
y | Int | increment to the current y-position |
Contains
Determines if position a point
method : public : Contains(p:Point) ~ Bool
Parameters
Name | Type | Description |
---|
p | Point | point |
Return
Type | Description |
---|
Bool | true of intersection, false otherwise |
Determines if position a point
method : public : Contains(x:Int, y:Int) ~ Bool
Parameters
Name | Type | Description |
---|
x | Int | x-position |
y | Int | y-position |
Return
Type | Description |
---|
Bool | true of intersection, false otherwise |
Distance
Calculates the distance between two points
method : private : Distance(x:Int, y:Int) ~ Int
Parameters
Name | Type | Description |
---|
x | Int | x-position |
y | Int | y-position |
Return
Type | Description |
---|
Int | distance between the two points |
Calculates the distance between two points
method : private : Distance(pos:Position) ~ Int
Parameters
Return
Type | Description |
---|
Int | distance between the two points |
GetBottom
Gets bottom position
method : public : GetBottom() ~ Int
Return
Type | Description |
---|
Int | bottom position |
GetCenterX
Gets the center x-position
method : public : GetCenterX() ~ Int
Return
Type | Description |
---|
Int | center x-position |
GetCenterY
Gets the center y-position
method : public : GetCenterY() ~ Int
Return
Type | Description |
---|
Int | center y-position |
GetLeft
Gets left position
method : public : GetLeft() ~ Int
Return
Type | Description |
---|
Int | left position |
GetRect
Gets bounding size
method : public : GetRect() ~ Rect
Return
Type | Description |
---|
Rect | size and rectangle |
GetRight
Gets right position
method : public : GetRight() ~ Int
Return
Type | Description |
---|
Int | right position |
GetTop
Gets top position
method : public : GetTop() ~ Int
Return
Type | Description |
---|
Int | top position |
IntersectsLine
Determines if position intersect line
method : public : IntersectsLine(x1:Int, y1:Int, x2:Int, y2:Int) ~ Bool
Parameters
Name | Type | Description |
---|
x1 | Int | 'x' start position |
y1 | Int | 'y' start position |
x2 | Int | 'x' end position |
y2 | Int | 'y' end position |
Return
Type | Description |
---|
Bool | true of intersection, false otherwise |
Overlaps
Determines if position overlaps rectangle
method : public : native : Overlaps(pos:Position) ~ Bool
Parameters
Name | Type | Description |
---|
pos | Position | position to test |
Return
Type | Description |
---|
Bool | true of overlap, false otherwise |
Set
Set upper left position
method : public : Set(x:Int, y:Int) ~ Nil
Parameters
Name | Type | Description |
---|
x | Int | x-position |
y | Int | y-position |
SetBottom
Sets bottom position
method : public : SetBottom(y2:Int) ~ Nil
Parameters
Name | Type | Description |
---|
y2 | Int | bottom position |
SetCenter
Set center position
method : public : SetCenter(x:Int, y:Int) ~ Nil
Parameters
Name | Type | Description |
---|
x | Int | x-position |
y | Int | y-position |
SetCenterX
Set center x-position
method : public : SetCenterX(x:Int) ~ Nil
Parameters
Name | Type | Description |
---|
x | Int | x-position |
SetCenterY
Set center y-position
method : public : SetCenterY(y:Int) ~ Nil
Parameters
Name | Type | Description |
---|
y | Int | y-position |
SetLeft
Sets left position
method : public : SetLeft(x:Int) ~ Nil
Parameters
Name | Type | Description |
---|
x | Int | x-position |
SetRight
Sets right position
method : public : SetRight(x2:Int) ~ Nil
Parameters
Name | Type | Description |
---|
x2 | Int | right position |
SetTop
Sets top position
method : public : SetTop(y:Int) ~ Nil
Parameters
Name | Type | Description |
---|
y | Int | top position |