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

Immutable rectangular area. More...

Inheritance diagram for RectArea:

Public Member Functions

Constructors
RectArea new ()
 Create rectangular area with all coordinates set to 0. More...
 
RectArea new (int x1, int y1, int x2, int y2)
 Create rectangular area with initial coordinates. More...
 
RectArea new (RectArea rect)
 Create copy of rectangular area. More...
 
RectArea new (Point position, Point size)
 Create recangular area from a point and size. More...
 
Management
int getX1 ()
 X1-Coordinate. More...
 
int getY1 ()
 Y1-Coordinate. More...
 
int getX2 ()
 X2-Coordinate. More...
 
int getY2 ()
 Y2-Coordinate. More...
 
RectArea orientate ()
 Orientate rectangular area placing (x1,y1) top-left and (x2,y2) bottom-right. More...
 
Point getSize ()
 Size. More...
 
RectArea move (int x, int y)
 Rectangular area moved by offset. More...
 
RectArea move (Point distance)
 Rectangular area moved by offset. More...
 
RectArea grow (int x, int y)
 Rectangular area grown by size at bottom right. More...
 
RectArea grow (Point size)
 Rectangular area grown by size at bottom right. More...
 
RectArea growInverse (int x, int y)
 Rectangular area grown by size at top left. More...
 
RectArea growInverse (Point size)
 Rectangular area grown by size at top left. More...
 
RectArea include (RectArea rect)
 Rectangular area grown to include another rectangular area. More...
 
RectArea intersect (RectArea rect)
 Rectangular set to the intersection area between two rectangular areas. More...
 
Point clamp (Point point)
 Point clamped to rectangular area. More...
 
bool isInside (int x, int y)
 Point is inside rectangular area. More...
 
bool isEqual (RectArea rect)
 Rrectangular areas is equal to another rectangular area. More...
 

File Handling

void writeToFile (FileWriter writer)
 Write rectangular area to file writer. More...
 
static RectArea readFromFile (FileReader reader)
 Read rectangular area from file reader. More...
 

Detailed Description

Immutable rectangular area.

Author
Roland Pl├╝ss
Version
1.0
Date
2015

Member Function Documentation

§ clamp()

Point clamp ( Point  point)

Point clamped to rectangular area.

§ getSize()

Point getSize ( )

Size.

§ getX1()

int getX1 ( )

X1-Coordinate.

§ getX2()

int getX2 ( )

X2-Coordinate.

§ getY1()

int getY1 ( )

Y1-Coordinate.

§ getY2()

int getY2 ( )

Y2-Coordinate.

§ grow() [1/2]

RectArea grow ( int  x,
int  y 
)

Rectangular area grown by size at bottom right.

§ grow() [2/2]

RectArea grow ( Point  size)

Rectangular area grown by size at bottom right.

§ growInverse() [1/2]

RectArea growInverse ( int  x,
int  y 
)

Rectangular area grown by size at top left.

§ growInverse() [2/2]

RectArea growInverse ( Point  size)

Rectangular area grown by size at top left.

§ include()

RectArea include ( RectArea  rect)

Rectangular area grown to include another rectangular area.

§ intersect()

RectArea intersect ( RectArea  rect)

Rectangular set to the intersection area between two rectangular areas.

§ isEqual()

bool isEqual ( RectArea  rect)

Rrectangular areas is equal to another rectangular area.

§ isInside()

bool isInside ( int  x,
int  y 
)

Point is inside rectangular area.

§ move() [1/2]

RectArea move ( int  x,
int  y 
)

Rectangular area moved by offset.

§ move() [2/2]

RectArea move ( Point  distance)

Rectangular area moved by offset.

§ new() [1/4]

RectArea new ( )

Create rectangular area with all coordinates set to 0.

§ new() [2/4]

RectArea new ( int  x1,
int  y1,
int  x2,
int  y2 
)

Create rectangular area with initial coordinates.

§ new() [3/4]

RectArea new ( RectArea  rect)

Create copy of rectangular area.

§ new() [4/4]

RectArea new ( Point  position,
Point  size 
)

Create recangular area from a point and size.

§ orientate()

RectArea orientate ( )

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

§ readFromFile()

static RectArea readFromFile ( FileReader  reader)
static

Read rectangular area from file reader.

§ writeToFile()

void writeToFile ( FileWriter  writer)

Write rectangular area to file writer.


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