Class Box
A box class (rectangle)
Usage:
b = Box!
Methods
box\new (x, y, width, height) | constructor passed a pos (x , y ) and width /height which must be numbers . |
box\contains (x, y) | tests if a given point is inside the box. |
box\getPosition () | getter for the box position. |
box\getSize () | getter for the box size. |
box\getWidth () | getter for the box width. |
box\getHeight () | getter for the box height. |
box\setPosition (x, y) | setter for the box position. |
box\getX () | getter for the circle x position. |
box\getY () | getter for the circle y position. |
box\setSize (width, height) | setter for the box size. |
Methods
- box\new (x, y, width, height)
-
constructor passed a pos (
x
,y
) andwidth
/height
which must benumbers
.Parameters:
- x number
- y number
- width number
- height number
- box\contains (x, y)
-
tests if a given point is inside the box.
Parameters:
- x number
- y number
Returns:
-
boolean
- box\getPosition ()
-
getter for the box position.
Returns:
- box\getSize ()
-
getter for the box size.
Returns:
- box\getWidth ()
-
getter for the box width.
Returns:
-
number
- box\getHeight ()
-
getter for the box height.
Returns:
-
number
- box\setPosition (x, y)
-
setter for the box position.
Parameters:
- x number
- y number
- box\getX ()
-
getter for the circle x position.
Returns:
-
number
- box\getY ()
-
getter for the circle y position.
Returns:
-
number
- box\setSize (width, height)
-
setter for the box size.
Parameters:
- width number
- height number