Package: pumpkin.geom

Rectangle


Description

The Rectangle class defines a 2d area of space indicated by a top-left (x & y) corner and a bottom right corner.



Constructors

Rectangle

Create empty Rectangle.

Rectangle

Create Rectangle from Rect class.

Rectangle

Create Rectangle from x,y, width & height.


Functions

clone

Create a copy of the Rectangle.

contains

Returns true if the x & y position is inside the rectangle.

intersection

Returns true if the other Rectangle intersects this one.


Variables

rect

Underlying Rect class.

x

Indicates the x position.

y

Indicates the y position.

width

Indicates the rectangle width.

height

Indicates the rectangle height.

left

Indicates the left edge.

top

Indicates the top edge.

right

Indicates the right edge, equivalent to x + width.

bottom

Indicates the bottom edge, equivalent to y + height.