PIXI.Bounds
class Bounds
'Builder' pattern for bounds rectangles.
This could be called an Axis-Aligned Bounding Box. It is not an actual shape. It is a mutable thing; no 'EMPTY' or those kind of problems.
Summary
Properties from Bounds
| number |
|
| number |
|
| number |
|
| number |
|
| number |
|
Methods from Bounds
Public Properties
maxX: number = -Infinity
maxY: number = -Infinity
minX: number = Infinity
minY: number = Infinity
updateID: number
It is updated to _boundsID of corresponding object to keep bounds in sync with content. Updated from outside, thus public modifier.
Public Methods
addBounds(bounds: PIXI.Bounds) → {void}
Adds other Bounds.
| Name | Type | Description |
|---|---|---|
| bounds | PIXI.Bounds |
The Bounds to be added |
| Type | Description |
|---|---|
| void |
addBoundsArea(bounds: PIXI.Bounds, area: PIXI.Rectangle) → {void}
Adds other Bounds, masked with Rectangle.
| Name | Type | Description |
|---|---|---|
| bounds | PIXI.Bounds |
TODO |
| area | PIXI.Rectangle |
TODO |
| Type | Description |
|---|---|
| void |
addBoundsMask(bounds: PIXI.Bounds, mask: PIXI.Bounds) → {void}
Adds other Bounds, masked with Bounds.
| Name | Type | Description |
|---|---|---|
| bounds | PIXI.Bounds |
The Bounds to be added. |
| mask | PIXI.Bounds |
TODO |
| Type | Description |
|---|---|
| void |
addBoundsMatrix(bounds: PIXI.Bounds, matrix: PIXI.Matrix) → {void}
Adds other Bounds, multiplied by matrix. Bounds shouldn't be empty.
| Name | Type | Description |
|---|---|---|
| bounds | PIXI.Bounds |
other bounds |
| matrix | PIXI.Matrix |
multiplicator |
| Type | Description |
|---|---|
| void |
addFrame(transform: PIXI.Transform, x0: number, y0: number, x1: number, y1: number) → {void}
Adds sprite frame, transformed.
| Name | Type | Description |
|---|---|---|
| transform | PIXI.Transform |
transform to apply |
| x0 | number |
left X of frame |
| y0 | number |
top Y of frame |
| x1 | number |
right X of frame |
| y1 | number |
bottom Y of frame |
| Type | Description |
|---|---|
| void |
addFrameMatrix(matrix: PIXI.Matrix, x0: number, y0: number, x1: number, y1: number) → {void}
Adds sprite frame, multiplied by matrix
| Name | Type | Description |
|---|---|---|
| matrix | PIXI.Matrix |
matrix to apply |
| x0 | number |
left X of frame |
| y0 | number |
top Y of frame |
| x1 | number |
right X of frame |
| y1 | number |
bottom Y of frame |
| Type | Description |
|---|---|
| void |
addFramePad(x0: number, y0: number, x1: number, y1: number, padX: number, padY: number) → {void}
Adds padded frame. (x0, y0) should be strictly less than (x1, y1)
| Name | Type | Description |
|---|---|---|
| x0 | number |
left X of frame |
| y0 | number |
top Y of frame |
| x1 | number |
right X of frame |
| y1 | number |
bottom Y of frame |
| padX | number |
padding X |
| padY | number |
padding Y |
| Type | Description |
|---|---|
| void |
addPoint(point: IPointData) → {void}
This function should be inlined when its possible.
| Name | Type | Description |
|---|---|---|
| point | IPointData |
The point to add. |
| Type | Description |
|---|---|
| void |
addPointMatrix(matrix: PIXI.Matrix, point: IPointData) → {void}
Adds a point, after transformed. This should be inlined when its possible.
| Name | Type | Description |
|---|---|---|
| matrix | PIXI.Matrix | |
| point | IPointData |
| Type | Description |
|---|---|
| void |
addQuad(vertices: Float32Array) → {void}
Adds a quad, not transformed
| Name | Type | Description |
|---|---|---|
| vertices | Float32Array |
The verts to add. |
| Type | Description |
|---|---|
| void |
addVertexData(vertexData: Float32Array, beginOffset: number, endOffset: number) → {void}
Adds screen vertices from array
| Name | Type | Description |
|---|---|---|
| vertexData | Float32Array |
calculated vertices |
| beginOffset | number |
begin offset |
| endOffset | number |
end offset, excluded |
| Type | Description |
|---|---|
| void |
addVertices(transform: PIXI.Transform, vertices: Float32Array, beginOffset: number, endOffset: number) → {void}
Add an array of mesh vertices
| Name | Type | Description |
|---|---|---|
| transform | PIXI.Transform |
mesh transform |
| vertices | Float32Array |
mesh coordinates in array |
| beginOffset | number |
begin offset |
| endOffset | number |
end offset, excluded |
| Type | Description |
|---|---|
| void |
addVerticesMatrix(matrix: PIXI.Matrix, vertices: Float32Array, beginOffset: number, endOffset: number, padX: number, padY) → {void}
Add an array of mesh vertices.
| Name | Type | Default | Description |
|---|---|---|---|
| matrix | PIXI.Matrix |
mesh matrix |
|
| vertices | Float32Array |
mesh coordinates in array |
|
| beginOffset | number |
begin offset |
|
| endOffset | number |
end offset, excluded |
|
| padX | number | 0 |
x padding |
| padY |
y padding |
| Type | Description |
|---|---|
| void |
getRectangle(rect: PIXI.Rectangle) → {PIXI.Rectangle}
Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle It is not guaranteed that it will return tempRect
| Name | Type | Attributes | Description |
|---|---|---|---|
| rect | PIXI.Rectangle |
<optional> |
Temporary object will be used if AABB is not empty |
| Type | Description |
|---|---|
| PIXI.Rectangle |
|
isEmpty() → {boolean}
Checks if bounds are empty.
| Type | Description |
|---|---|
| boolean |
|
pad(paddingX: number, paddingY) → {void}
Pads bounds object, making it grow in all directions. If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
| Name | Type | Default | Description |
|---|---|---|---|
| paddingX | number | 0 |
The horizontal padding amount. |
| paddingY |
The vertical padding amount. |
| Type | Description |
|---|---|
| void |