Constructors
constructor
- new Rectangle(x?: number, y?: number, width?: number, height?: number): Rectangle
-
Parameters
-
Default value x: number = 0
-
Default value y: number = 0
-
Default value width: number = 0
-
Default value height: number = 0
Accessors
bottom
- get bottom(): number
- set bottom(value: number): void
-
Returns number
-
Parameters
Returns void
left
- get left(): number
- set left(value: number): void
-
Returns number
-
Parameters
Returns void
location
- get location(): Point
- set location(value: Point): void
right
- get right(): number
- set right(value: number): void
-
Returns number
-
Parameters
Returns void
size
- get size(): Size
- set size(value: Size): void
top
- get top(): number
- set top(value: number): void
-
Returns number
-
Parameters
Returns void
Methods
alignToGrid
- alignToGrid(gridSize: number, aligningToGrid: boolean): Rectangle
-
Parameters
-
gridSize: number
-
aligningToGrid: boolean
contains
- contains(x: number, y: number): boolean
-
Parameters
Returns boolean
inflate
- inflate(width: number, height: number): Rectangle
-
Parameters
-
width: number
-
height: number
intersectsWith
-
Parameters
Returns boolean
Static fromLTRB
- fromLTRB(left: number, top: number, right: number, bottom: number): Rectangle
-
Parameters
-
left: number
-
top: number
-
right: number
-
bottom: number