|
Drag[en]gine Script Module DragonScript 1.35
|
Immutable floating vector2 rectangular area. More...
Public Member Functions | |
Constructors | |
| FloatRectArea | new () |
| Create rectangular area with all coordinates set to 0. | |
| FloatRectArea | new (float x1, float y1, float x2, float y2) |
| Create rectangular area with initial coordinates. | |
| FloatRectArea | new (FloatRectArea rect) |
| Create copy of rectangular area. | |
| FloatRectArea | new (Vector2 position, Vector2 size) |
| Create recangular area from a vector2 and size. | |
Management | |
| float | getX1 () |
| X1-Coordinate. | |
| float | getY1 () |
| Y1-Coordinate. | |
| float | getX2 () |
| X2-Coordinate. | |
| float | getY2 () |
| Y2-Coordinate. | |
| FloatRectArea | orientate () |
| Orientate rectangular area placing (x1,y1) top-left and (x2,y2) bottom-right. | |
| Vector2 | getTopLeft () |
| Top-left coordinates. | |
| Vector2 | getTopRight () |
| Top-right coordinates. | |
| Vector2 | getBottomLeft () |
| Bottom-left coordinates. | |
| Vector2 | getBottomRight () |
| Bottom-right coordinates. | |
| float | getWidth () |
| Width. | |
| float | getHeight () |
| Height. | |
| Vector2 | getSize () |
| Size. | |
| FloatRectArea | move (float x, float y) |
| Rectangular area moved by offset. | |
| FloatRectArea | move (Vector2 distance) |
| Rectangular area moved by offset. | |
| FloatRectArea | grow (float x, float y) |
| Rectangular area grown by size at bottom right. | |
| FloatRectArea | grow (Vector2 size) |
| Rectangular area grown by size at bottom right. | |
| FloatRectArea | growInverse (float x, float y) |
| Rectangular area grown by size at top left. | |
| FloatRectArea | growInverse (Vector2 size) |
| Rectangular area grown by size at top left. | |
| FloatRectArea | enlarge (float x, float y) |
| Rectangular area enlarged on all sides. | |
| FloatRectArea | enlarge (Vector2 size) |
| Rectangular area enlarged on all sides. | |
| FloatRectArea | include (FloatRectArea rect) |
| Rectangular area grown to include another rectangular area. | |
| FloatRectArea | intersect (FloatRectArea rect) |
| Rectangular set to the intersection area between two rectangular areas. | |
| Vector2 | clamp (Vector2 vector2) |
| Vector2 clamped to rectangular area. | |
| bool | isInside (float x, float y) |
| Vector2 is inside rectangular area. | |
| bool | isInside (Vector2 point) |
| Vector2 is inside rectangular area. | |
| String | toString () |
| String representation. | |
File Handling | |
| void | writeToFile (FileWriter writer) |
| Write floating point rectangular area to file writer. | |
| static FloatRectArea | readFromFile (FileReader reader) |
| Read floating point rectangular area from file reader. | |
Immutable floating vector2 rectangular area.
Most methods only produce correct results if the rect area is properly oriented. If you are not sure the orientation is correct call orientate() to obtain a rect area guaranteed to be correctly oriented.
| FloatRectArea Dragengine.Scenery.FloatRectArea.enlarge | ( | float | x, |
| float | y ) |
Rectangular area enlarged on all sides.
Referenced by writeToFile().
| FloatRectArea Dragengine.Scenery.FloatRectArea.enlarge | ( | Vector2 | size | ) |
Rectangular area enlarged on all sides.
| Vector2 Dragengine.Scenery.FloatRectArea.getBottomLeft | ( | ) |
Bottom-left coordinates.
Referenced by isInside().
| Vector2 Dragengine.Scenery.FloatRectArea.getBottomRight | ( | ) |
| float Dragengine.Scenery.FloatRectArea.getHeight | ( | ) |
| Vector2 Dragengine.Scenery.FloatRectArea.getSize | ( | ) |
| Vector2 Dragengine.Scenery.FloatRectArea.getTopLeft | ( | ) |
Top-left coordinates.
Referenced by include().
| Vector2 Dragengine.Scenery.FloatRectArea.getTopRight | ( | ) |
| float Dragengine.Scenery.FloatRectArea.getWidth | ( | ) |
Width.
Referenced by toString().
| float Dragengine.Scenery.FloatRectArea.getX1 | ( | ) |
X1-Coordinate.
Referenced by getTopRight().
| float Dragengine.Scenery.FloatRectArea.getX2 | ( | ) |
X2-Coordinate.
Referenced by getHeight().
| float Dragengine.Scenery.FloatRectArea.getY1 | ( | ) |
Y1-Coordinate.
Referenced by getBottomRight().
| float Dragengine.Scenery.FloatRectArea.getY2 | ( | ) |
Y2-Coordinate.
Referenced by getSize().
| FloatRectArea Dragengine.Scenery.FloatRectArea.grow | ( | float | x, |
| float | y ) |
Rectangular area grown by size at bottom right.
Referenced by writeToFile().
| FloatRectArea Dragengine.Scenery.FloatRectArea.grow | ( | Vector2 | size | ) |
Rectangular area grown by size at bottom right.
| FloatRectArea Dragengine.Scenery.FloatRectArea.growInverse | ( | float | x, |
| float | y ) |
Rectangular area grown by size at top left.
Referenced by writeToFile().
| FloatRectArea Dragengine.Scenery.FloatRectArea.growInverse | ( | Vector2 | size | ) |
Rectangular area grown by size at top left.
| FloatRectArea Dragengine.Scenery.FloatRectArea.include | ( | FloatRectArea | rect | ) |
Rectangular area grown to include another rectangular area.
References getTopLeft().
Referenced by writeToFile().
| FloatRectArea Dragengine.Scenery.FloatRectArea.intersect | ( | FloatRectArea | rect | ) |
Rectangular set to the intersection area between two rectangular areas.
Referenced by writeToFile().
| bool Dragengine.Scenery.FloatRectArea.isInside | ( | float | x, |
| float | y ) |
| bool Dragengine.Scenery.FloatRectArea.isInside | ( | Vector2 | point | ) |
Vector2 is inside rectangular area.
References getBottomRight().
| FloatRectArea Dragengine.Scenery.FloatRectArea.move | ( | float | x, |
| float | y ) |
Rectangular area moved by offset.
Referenced by writeToFile().
| FloatRectArea Dragengine.Scenery.FloatRectArea.move | ( | Vector2 | distance | ) |
Rectangular area moved by offset.
References orientate().
| FloatRectArea Dragengine.Scenery.FloatRectArea.new | ( | ) |
| FloatRectArea Dragengine.Scenery.FloatRectArea.new | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2 ) |
Create rectangular area with initial coordinates.
| FloatRectArea Dragengine.Scenery.FloatRectArea.new | ( | FloatRectArea | rect | ) |
Create copy of rectangular area.
| FloatRectArea Dragengine.Scenery.FloatRectArea.new | ( | Vector2 | position, |
| Vector2 | size ) |
Create recangular area from a vector2 and size.
| FloatRectArea Dragengine.Scenery.FloatRectArea.orientate | ( | ) |
Orientate rectangular area placing (x1,y1) top-left and (x2,y2) bottom-right.
Referenced by move().
|
static |
Read floating point rectangular area from file reader.
References getHeight().
Referenced by writeToFile().
| String Dragengine.Scenery.FloatRectArea.toString | ( | ) |
| void Dragengine.Scenery.FloatRectArea.writeToFile | ( | FileWriter | writer | ) |
Write floating point rectangular area to file writer.
References clamp(), enlarge(), getSize(), grow(), growInverse(), include(), intersect(), isInside(), move(), readFromFile(), toString(), and writeToFile().
Referenced by writeToFile().