public class Rect extends Object
Constructor and Description |
---|
Rect()
Constructs a new Rectangle whose upper-left corner is at (0, 0) in the coordinate
space, and whose width and height are both zero.
|
Rect(int x,
int y,
int width,
int height)
Constructs a new Rectangle whose upper-left corner is specified as (x,y) and whose
width and height are specified by the arguments of the same name.
|
Rect(Rect r)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
float |
centerX()
Returns the X coordinate of the center of the rectangle.
|
float |
centerY()
Returns the Y coordinate of the center of the rectangle.
|
boolean |
equals(Object obj) |
int |
hashCode() |
int |
height() |
void |
setHeight(int h) |
void |
setWidth(int w) |
void |
setX(int xVal)
Sets the x coordinate
|
void |
setY(int yVal)
Sets the y coordinate
|
int |
width() |
float |
x() |
float |
y() |
public Rect()
public Rect(Rect r)
r
- the rectangle to be copiedpublic Rect(int x, int y, int width, int height)
public float x()
public float y()
public void setX(int xVal)
xVal
- public void setY(int yVal)
yVal
- public int width()
public int height()
public void setWidth(int w)
w
- widthpublic void setHeight(int h)
h
- heightpublic float centerX()
public float centerY()
Processing Library proscene by Jean Pierre Charalambos. (c) 2014-2017 National University of Colombia