|
Drag[en]gine Script Module DragonScript 1.35
|
Immutable rectangular area. More...
Public Member Functions | |
Constructors | |
| RectArea | new () |
| Create rectangular area with all coordinates set to 0. | |
| RectArea | new (int x1, int y1, int x2, int y2) |
| Create rectangular area with initial coordinates. | |
| RectArea | new (RectArea rect) |
| Create copy of rectangular area. | |
| RectArea | new (Point position, Point size) |
| Create recangular area from a point and size. | |
Management | |
| int | getX1 () |
| X1-Coordinate. | |
| int | getY1 () |
| Y1-Coordinate. | |
| int | getX2 () |
| X2-Coordinate. | |
| int | getY2 () |
| Y2-Coordinate. | |
| RectArea | orientate () |
| Orientate rectangular area placing (x1,y1) top-left and (x2,y2) bottom-right. | |
| Point | getPosition () |
| Position. | |
| Point | getSize () |
| Size. | |
| int | getWidth () |
| Width. | |
| int | getHeight () |
| Height. | |
| Point | getTopLeft () |
| Top-left corner (x1, y1). | |
| Point | getTopRight () |
| Top-right corner (x2, y1). | |
| Point | getBottomLeft () |
| Bottom-left corner (x1, y2). | |
| Point | getBottomRight () |
| Bottom-right corner (x2, y2). | |
| RectArea | move (int x, int y) |
| Rectangular area moved by offset. | |
| RectArea | move (Point distance) |
| Rectangular area moved by offset. | |
| RectArea | grow (int x, int y) |
| Rectangular area grown by size at bottom right. | |
| RectArea | grow (Point size) |
| Rectangular area grown by size at bottom right. | |
| RectArea | growInverse (int x, int y) |
| Rectangular area grown by size at top left. | |
| RectArea | growInverse (Point size) |
| Rectangular area grown by size at top left. | |
| RectArea | include (RectArea rect) |
| Rectangular area grown to include another rectangular area. | |
| RectArea | intersect (RectArea rect) |
| Rectangular area set to the intersection area between two rectangular areas. | |
| Point | clamp (Point point) |
| Point clamped to rectangular area. | |
| bool | isZeroWidth () |
| Width is 0 (x1=x2). | |
| bool | isZeroHeight () |
| Height is 0 (y1=y2). | |
| bool | isZeroSize () |
| Size is 0 (x1=x2, y1=y2). | |
| bool | isZeroWidthOrHeight () |
| Width or height is 0 (x1=x2 or y1=y2). | |
| bool | isInside (int x, int y) |
| Point is inside rectangular area. | |
| bool | isInsideX (int x) |
| Point is inside rectangular area along X axis. | |
| bool | isInsideY (int y) |
| Point is inside rectangular area along Y axis. | |
| bool | isOverlapping (RectArea rect) |
| Rectangular areas overlap. | |
| bool | isOverlappingX (RectArea rect) |
| Rectangular areas overlap in X direction. | |
| bool | isOverlappingY (RectArea rect) |
| Rectangular areas overlap in Y direction. | |
| bool | isEqual (RectArea rect) |
| Rectangular areas is equal to another rectangular area. | |
| String | toString () |
| String representation. | |
Public Attributes | |
| int | pX1 |
File Handling | |
| void | writeToFile (FileWriter writer) |
| Write rectangular area to file writer. | |
| static RectArea | readFromFile (FileReader reader) |
| Read rectangular area from file reader. | |
Immutable rectangular area.
Coordinate (x2,y2) is exclusive. Hence the rectangular area includes all points except row y2 and column x2.
Point clamped to rectangular area.
This excludes the row y2 and column x2 unless the width or height is 0.
References getTopLeft(), and pX1.
Referenced by toString().
| Point Dragengine.Gui.RectArea.getBottomLeft | ( | ) |
| Point Dragengine.Gui.RectArea.getBottomRight | ( | ) |
| int Dragengine.Gui.RectArea.getHeight | ( | ) |
| Point Dragengine.Gui.RectArea.getPosition | ( | ) |
| Point Dragengine.Gui.RectArea.getTopLeft | ( | ) |
| Point Dragengine.Gui.RectArea.getTopRight | ( | ) |
| int Dragengine.Gui.RectArea.getWidth | ( | ) |
| int Dragengine.Gui.RectArea.getX1 | ( | ) |
X1-Coordinate.
Referenced by getPosition().
| int Dragengine.Gui.RectArea.getX2 | ( | ) |
| int Dragengine.Gui.RectArea.getY2 | ( | ) |
Y2-Coordinate.
Referenced by getHeight().
| RectArea Dragengine.Gui.RectArea.grow | ( | int | x, |
| int | y ) |
Rectangular area grown by size at bottom right.
References getSize(), and pX1.
Referenced by isInsideX(), and isInsideY().
| RectArea Dragengine.Gui.RectArea.growInverse | ( | int | x, |
| int | y ) |
Rectangular area grown by size at top left.
References getWidth().
Referenced by isInsideY(), and isOverlapping().
Rectangular area grown by size at top left.
References pX1.
Rectangular area grown to include another rectangular area.
Referenced by isOverlappingX().
Rectangular area set to the intersection area between two rectangular areas.
References getHeight().
Referenced by isOverlappingY().
| bool Dragengine.Gui.RectArea.isEqual | ( | RectArea | rect | ) |
Rectangular areas is equal to another rectangular area.
Referenced by writeToFile().
| bool Dragengine.Gui.RectArea.isInside | ( | int | x, |
| int | y ) |
Point is inside rectangular area.
This excludes the row y2 and column x2. If the width or height is 0 the point is never inside.
Referenced by writeToFile().
| bool Dragengine.Gui.RectArea.isInsideX | ( | int | x | ) |
Point is inside rectangular area along X axis.
This excludes the column x2. If the width is 0 the point is never inside.
Referenced by writeToFile().
| bool Dragengine.Gui.RectArea.isInsideY | ( | int | y | ) |
Point is inside rectangular area along Y axis.
This excludes the row y2. If the height is 0 the point is never inside.
References grow(), growInverse(), and pX1.
Referenced by writeToFile().
| bool Dragengine.Gui.RectArea.isOverlapping | ( | RectArea | rect | ) |
| bool Dragengine.Gui.RectArea.isOverlappingX | ( | RectArea | rect | ) |
Rectangular areas overlap in X direction.
References include(), and pX1.
Referenced by writeToFile().
| bool Dragengine.Gui.RectArea.isOverlappingY | ( | RectArea | rect | ) |
Rectangular areas overlap in Y direction.
References intersect(), and pX1.
Referenced by writeToFile().
| bool Dragengine.Gui.RectArea.isZeroHeight | ( | ) |
| bool Dragengine.Gui.RectArea.isZeroSize | ( | ) |
Size is 0 (x1=x2, y1=y2).
References getBottomLeft(), and pX1.
Referenced by writeToFile().
| bool Dragengine.Gui.RectArea.isZeroWidth | ( | ) |
| bool Dragengine.Gui.RectArea.isZeroWidthOrHeight | ( | ) |
Width or height is 0 (x1=x2 or y1=y2).
References getBottomRight().
Referenced by writeToFile().
| RectArea Dragengine.Gui.RectArea.move | ( | int | x, |
| int | y ) |
| RectArea Dragengine.Gui.RectArea.new | ( | ) |
| RectArea Dragengine.Gui.RectArea.new | ( | int | x1, |
| int | y1, | ||
| int | x2, | ||
| int | y2 ) |
Create recangular area from a point and size.
References pX1.
| RectArea Dragengine.Gui.RectArea.orientate | ( | ) |
Orientate rectangular area placing (x1,y1) top-left and (x2,y2) bottom-right.
Referenced by getTopLeft().
|
static |
Read rectangular area from file reader.
Referenced by writeToFile().
| String Dragengine.Gui.RectArea.toString | ( | ) |
| void Dragengine.Gui.RectArea.writeToFile | ( | FileWriter | writer | ) |
Write rectangular area to file writer.
References isEqual(), isInside(), isInsideX(), isInsideY(), isOverlapping(), isOverlappingX(), isOverlappingY(), isZeroHeight(), isZeroSize(), isZeroWidth(), isZeroWidthOrHeight(), pX1, readFromFile(), toString(), and writeToFile().
Referenced by writeToFile().
| int Dragengine.Gui.RectArea.pX1 |
Referenced by clamp(), getPosition(), getTopLeft(), getTopRight(), getX2(), getY1(), grow(), growInverse(), isInside(), isInsideX(), isInsideY(), isOverlappingX(), isOverlappingY(), isZeroSize(), move(), new(), new(), toString(), and writeToFile().