home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
404 Jogos
/
CLJG.iso
/
Puzzle
/
Easter_Eggs.swf
/
scripts
/
__Packages
/
com
/
novelgames
/
flashgames
/
commonAS2
/
Rectangle.as
< prev
next >
Wrap
Text File
|
2008-09-04
|
1KB
|
70 lines
class com.novelgames.flashgames.commonAS2.Rectangle
{
function Rectangle(x, y, width, height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
}
function get left()
{
return this.x;
}
function set left(left)
{
this.x = left;
}
function get top()
{
return this.y;
}
function set top(top)
{
this.y = top;
}
function get right()
{
return this.x + this.width;
}
function set right(right)
{
this.width = right - this.x;
}
function get bottom()
{
return this.y + this.height;
}
function set bottom(bottom)
{
this.height = bottom - this.y;
}
function get size()
{
return {x:this.width,y:this.height};
}
function set size(size)
{
this.width = size.x;
this.height = size.y;
}
function get topLeft()
{
return {x:this.x,y:this.y};
}
function set topLeft(topLeft)
{
this.x = topLeft.x;
this.y = topLeft.y;
}
function get bottomRight()
{
return {x:this.x + this.width,y:this.y + this.height};
}
function set bottomRight(bottomRight)
{
this.width = this.x - bottomRight.x;
this.height = this.y - bottomRight.y;
}
}