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