A Rect describes a rectangular two-dimensional area as a top-left point (x and y values) and a size (width and height values).
The default constructor (no argument) results in a Rect(0,0,0,0).
The constructor taking two Points produces a Rect that spans both points.
The constructor taking a Point and a Size produces a Rect at that point with that size.
The four-argument constructor takes four numbers for the x, y, width, height.
Top-left x value.
Top-left y value.
Width to be used; must be non-negative.
Height to be used; must be non-negative.
Gets or sets the y-axis value of the bottom of the Rect.
Gets or sets the Point at the center of this Rect.
Gets or sets the horizontal center X coordinate of the Rect.
Gets or sets the vertical center Y coordinate of the Rect.
Gets or sets the height of the Rect.
Gets or sets the leftmost value of the Rect.
Gets or sets the x- and y-axis position of the Rect as a Point.
Gets or sets the x-axis value of the right of the Rect.
Gets or sets the width and height of the Rect as a Size.
Gets or sets the topmost value of the Rect.
Gets or sets the width of the Rect.
Gets or sets the top-left x coordinate of the Rect.
Gets or sets the top-left y coordinate of the Rect.
Modify this Rect by adding the given Margin to each side of the Rect.
The Margin to add to the Rect.
Indicates whether this Rect contains the given Point/Rect.
The X coordinate of the Point or Rect to include in the new bounds.
The Y coordinate of the Point or Rect to include in the new bounds.
The Width of the Rect to include in the new bounds, defaults to zero.
The Height of the Rect to include in the new bounds, defaults to zero. false otherwise.
boolean
This static method indicates whether a Rect contains the given Point/Rect.
The X coordinate of a Rect.
The Y coordinate of a Rect.
The Width of a Rect.
The Height of a Rect.
The X coordinate of the Point or Rect that might be in the bounds (RX, RY, RW, RH).
The Y coordinate of the Point or Rect that might be in the bounds (RX, RY, RW, RH).
The Width of the Rect to include in the new bounds, defaults to zero.
The Height of the Rect to include in the new bounds, defaults to zero. false otherwise.
boolean
Indicates whether this Rect contains the given Point.
The Point to check. false otherwise.
boolean
Indicates whether this Rect contains the given Rect.
The Rect to check. false otherwise.
boolean
Create a copy of this Rect, with the same values.
Indicates whether the given Rect is equal to the current Rect.
the width.
the height.
boolean
Indicates whether the given Rect is equal to the current Rect.
The rectangle to compare to the current rectangle. and height.
boolean
Modifies this Rect by adding some distance to each side of the Rect.
the amount to move the top side upwards; may be negative.
the amount to move the right side rightwards; may be negative.
the amount to move the bottom side downwards; may be negative.
the amount to move the left side leftwards; may be negative.
Modify this Rect so that its width and height are changed on all four sides, equally on the left and right sides, and equally on the top and bottom sides. When the arguments are negative, this operation deflates this Rect, but not beyond zero.
The additional width on each side, left and right; may be negative.
The additional height on each side, top and bottom; may be negative.
Modify this Rect so that it is the intersection of this Rect and the rectangle defined by x, y, w, h.
Modify this Rect so that it is the intersection of this Rect and the given Rect.
Rect to intersect with.
This static method indicates whether a Rect partly or wholly overlaps the given Rect.
The X coordinate of a Rect.
The Y coordinate of a Rect.
The Width of a Rect.
The Height of a Rect.
The X coordinate of the Point or Rect that might overlap the bounds (RX, RY, RW, RH).
The Y coordinate of the Point or Rect that might overlap the bounds (RX, RY, RW, RH).
boolean
Determine if this Rect partly or wholly overlaps the rectangle defined by x, y, w, h.
boolean
Determine if a given Rect is partly or wholly inside of this Rect.
Rect to test intersection with.
boolean
True if this Rect has a Width and Height of zero.
boolean
True if this Rect has X, Y, Width, and Height values that are real numbers and not infinity.
boolean
Modify this Rect by shifting its values with the given DX and DY offsets.
This static method can be used to read in a Rect from a string that was produced by Rect.stringify.
Modify this Rect so that its X, Y, Width, and Height values are the same as the given Rect.
the given Rect.
Modify this Rect so that its X and Y values are the same as the given Point.
the given Point.
Modify this Rect so that its Width and Height values are the same as the given Size.
the given Size.
Modify this Rect so that a given Spot is at a given (x,y) point using this Rect's size. Return this rectangle for which the spot is at that point, without modifying the size. The result is meaningless if Spot#isNoSpot is true.
the point where the spot should be.
the point where the spot should be.
a Spot; Spot#isSpot must be true.
Modify this Rect with new X, Y, Width, and Height values.
the width.
the height.
This static method can be used to write out a Rect as a string that can be read by Rect.parse.
string
Modify this Rect by subtracting the given Margin from each side of the Rect.
The Margin to subtract from the Rect.
Modify this Rect to be exactly big enough to contain both the original Rect and the given rectangular area.
The X coordinate of the Point or Rect to include in the new bounds.
The Y coordinate of the Point or Rect to include in the new bounds.
The Width of the Rect to include in the new bounds, defaults to zero.
The Height of the Rect to include in the new bounds, defaults to zero.
Modify this Rect to be exactly big enough to contain both the original Rect and the given Point.
The Point to include in the new bounds.
Modify this Rect to be exactly big enough to contain this Rect and the given Rect.
The Rect to include in the new bounds.