- Preparing search index...
- The search index is not available
feng3d
Constructors
constructor
- new Rectangle(x?: number, y?: number, width?: number, height?: number): Rectangle
-
Parameters
-
x: number = 0
-
y: number = 0
-
width: number = 0
-
height: number = 0
Accessors
bottom
- get bottom(): number
-
Returns number
- set bottom(value: number): void
-
Returns void
bottomRight
- get bottomRight(): Vector2
-
- set bottomRight(value: Vector2): void
-
Returns void
left
- get left(): number
-
Returns number
- set left(value: number): void
-
Returns void
right
- get right(): number
-
Returns number
- set right(value: number): void
-
Returns void
top
- get top(): number
-
Returns number
- set top(value: number): void
-
Returns void
Methods
contains
- contains(x: number, y: number): boolean
-
Returns boolean
containsPoint
- containsPoint(point: Vector2): boolean
-
Returns boolean
containsRect
- containsRect(rect: Rectangle): boolean
-
Returns boolean
equals
- equals(toCompare: Rectangle): boolean
-
Returns boolean
inflate
- inflate(dx: number, dy: number): void
-
Returns void
inflatePoint
- inflatePoint(point: Vector2): void
-
Returns void
init
- init(x: number, y: number, width: number, height: number): Rectangle
-
Parameters
-
x: number
-
y: number
-
width: number
-
height: number
intersects
- intersects(toIntersect: Rectangle): boolean
-
Returns boolean
isEmpty
- isEmpty(): boolean
-
Returns boolean
offset
- offset(dx: number, dy: number): void
-
Returns void
offsetPoint
- offsetPoint(point: Vector2): void
-
Returns void
setEmpty
- setEmpty(): void
-
Returns void
toString
- toString(): string
-
Returns string
矩形
Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。