Drag[en]gine Script Module DragonScript Script API  1.0
FloatRectArea Class Reference

Immutable floating vector2 rectangular area. More...

Inheritance diagram for 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 getBottomRight ()
 Bottom-right coordinates. 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 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.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ clamp()

Vector2 clamp ( Vector2  vector2)

Vector2 clamped to rectangular area.

§ getBottomRight()

Vector2 getBottomRight ( )

Bottom-right coordinates.

§ getSize()

Vector2 getSize ( )

Size.

§ getTopLeft()

Vector2 getTopLeft ( )

Top-left coordinates.

§ getX1()

float getX1 ( )

X1-Coordinate.

§ getX2()

float getX2 ( )

X2-Coordinate.

§ getY1()

float getY1 ( )

Y1-Coordinate.

§ getY2()

float getY2 ( )

Y2-Coordinate.

§ grow() [1/2]

FloatRectArea grow ( float  x,
float  y 
)

Rectangular area grown by size at bottom right.

§ grow() [2/2]

FloatRectArea grow ( Vector2  size)

Rectangular area grown by size at bottom right.

§ growInverse() [1/2]

FloatRectArea growInverse ( float  x,
float  y 
)

Rectangular area grown by size at top left.

§ growInverse() [2/2]

FloatRectArea growInverse ( Vector2  size)

Rectangular area grown by size at top left.

§ include()

FloatRectArea include ( FloatRectArea  rect)

Rectangular area grown to include another rectangular area.

§ intersect()

FloatRectArea intersect ( FloatRectArea  rect)

Rectangular set to the intersection area between two rectangular areas.

§ isInside() [1/2]

bool isInside ( float  x,
float  y 
)

Vector2 is inside rectangular area.

§ isInside() [2/2]

bool isInside ( Vector2  point)

Vector2 is inside rectangular area.

§ move() [1/2]

FloatRectArea move ( float  x,
float  y 
)

Rectangular area moved by offset.

§ move() [2/2]

FloatRectArea move ( Vector2  distance)

Rectangular area moved by offset.

§ new() [1/4]

FloatRectArea new ( )

Create rectangular area with all coordinates set to 0.

§ new() [2/4]

FloatRectArea new ( float  x1,
float  y1,
float  x2,
float  y2 
)

Create rectangular area with initial coordinates.

§ new() [3/4]

Create copy of rectangular area.

§ new() [4/4]

FloatRectArea new ( Vector2  position,
Vector2  size 
)

Create recangular area from a vector2 and size.

§ orientate()

FloatRectArea orientate ( )

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

§ readFromFile()

static FloatRectArea readFromFile ( FileReader  reader)
static

Read floating point rectangular area from file reader.

§ toString()

String toString ( )

String representation.

§ writeToFile()

void writeToFile ( FileWriter  writer)

Write floating point rectangular area to file writer.


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