Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.FloatRectArea Class Reference

Immutable floating vector2 rectangular area. More...

Inheritance diagram for Dragengine.Scenery.FloatRectArea:

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...
 

Detailed Description

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.

Member Function Documentation

◆ clamp()

Vector2 Dragengine.Scenery.FloatRectArea.clamp ( Vector2  vector2)

Vector2 clamped to rectangular area.

◆ enlarge() [1/2]

FloatRectArea Dragengine.Scenery.FloatRectArea.enlarge ( float  x,
float  y 
)

Rectangular area enlarged on all sides.

◆ enlarge() [2/2]

FloatRectArea Dragengine.Scenery.FloatRectArea.enlarge ( Vector2  size)

Rectangular area enlarged on all sides.

◆ getBottomLeft()

Vector2 Dragengine.Scenery.FloatRectArea.getBottomLeft ( )

Bottom-left coordinates.

◆ getBottomRight()

Vector2 Dragengine.Scenery.FloatRectArea.getBottomRight ( )

Bottom-right coordinates.

◆ getHeight()

float Dragengine.Scenery.FloatRectArea.getHeight ( )

Height.

◆ getSize()

Vector2 Dragengine.Scenery.FloatRectArea.getSize ( )

Size.

◆ getTopLeft()

Vector2 Dragengine.Scenery.FloatRectArea.getTopLeft ( )

Top-left coordinates.

◆ getTopRight()

Vector2 Dragengine.Scenery.FloatRectArea.getTopRight ( )

Top-right coordinates.

◆ getWidth()

float Dragengine.Scenery.FloatRectArea.getWidth ( )

Width.

◆ getX1()

float Dragengine.Scenery.FloatRectArea.getX1 ( )

X1-Coordinate.

◆ getX2()

float Dragengine.Scenery.FloatRectArea.getX2 ( )

X2-Coordinate.

◆ getY1()

float Dragengine.Scenery.FloatRectArea.getY1 ( )

Y1-Coordinate.

◆ getY2()

float Dragengine.Scenery.FloatRectArea.getY2 ( )

Y2-Coordinate.

◆ grow() [1/2]

FloatRectArea Dragengine.Scenery.FloatRectArea.grow ( float  x,
float  y 
)

Rectangular area grown by size at bottom right.

◆ grow() [2/2]

FloatRectArea Dragengine.Scenery.FloatRectArea.grow ( Vector2  size)

Rectangular area grown by size at bottom right.

◆ growInverse() [1/2]

FloatRectArea Dragengine.Scenery.FloatRectArea.growInverse ( float  x,
float  y 
)

Rectangular area grown by size at top left.

◆ growInverse() [2/2]

FloatRectArea Dragengine.Scenery.FloatRectArea.growInverse ( Vector2  size)

Rectangular area grown by size at top left.

◆ include()

FloatRectArea Dragengine.Scenery.FloatRectArea.include ( FloatRectArea  rect)

Rectangular area grown to include another rectangular area.

◆ intersect()

FloatRectArea Dragengine.Scenery.FloatRectArea.intersect ( FloatRectArea  rect)

Rectangular set to the intersection area between two rectangular areas.

◆ isInside() [1/2]

bool Dragengine.Scenery.FloatRectArea.isInside ( float  x,
float  y 
)

Vector2 is inside rectangular area.

◆ isInside() [2/2]

bool Dragengine.Scenery.FloatRectArea.isInside ( Vector2  point)

Vector2 is inside rectangular area.

◆ move() [1/2]

FloatRectArea Dragengine.Scenery.FloatRectArea.move ( float  x,
float  y 
)

Rectangular area moved by offset.

◆ move() [2/2]

FloatRectArea Dragengine.Scenery.FloatRectArea.move ( Vector2  distance)

Rectangular area moved by offset.

◆ new() [1/4]

FloatRectArea Dragengine.Scenery.FloatRectArea.new ( )

Create rectangular area with all coordinates set to 0.

◆ new() [2/4]

FloatRectArea Dragengine.Scenery.FloatRectArea.new ( float  x1,
float  y1,
float  x2,
float  y2 
)

Create rectangular area with initial coordinates.

◆ new() [3/4]

FloatRectArea Dragengine.Scenery.FloatRectArea.new ( FloatRectArea  rect)

Create copy of rectangular area.

◆ new() [4/4]

FloatRectArea Dragengine.Scenery.FloatRectArea.new ( Vector2  position,
Vector2  size 
)

Create recangular area from a vector2 and size.

◆ orientate()

FloatRectArea Dragengine.Scenery.FloatRectArea.orientate ( )

Orientate rectangular area placing (x1,y1) top-left and (x2,y2) bottom-right.

◆ readFromFile()

static FloatRectArea Dragengine.Scenery.FloatRectArea.readFromFile ( FileReader  reader)
static

Read floating point rectangular area from file reader.

◆ toString()

String Dragengine.Scenery.FloatRectArea.toString ( )

String representation.

◆ writeToFile()

void Dragengine.Scenery.FloatRectArea.writeToFile ( FileWriter  writer)

Write floating point rectangular area to file writer.


The documentation for this class was generated from the following file: