Class: Bounds

PIXI.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.

Members

maxX number

Default Value:
  • 0

maxY number

Default Value:
  • 0

minX number

Default Value:
  • 0

minY number

Default Value:
  • 0

updateID number

It is updated to _boundsID of corresponding object to keep bounds in sync with content. Updated from outside, thus public modifier.

Default Value:
  • -1

Methods

addBounds (bounds) void

Bounds.ts:346

Adds other Bounds.

Name Type Description
bounds PIXI.Bounds

The Bounds to be added

addBoundsArea (bounds, area) void

Bounds.ts:402

Adds other Bounds, masked with Rectangle.

Name Type Description
bounds PIXI.Bounds

TODO

area PIXI.Rectangle

TODO

addBoundsMask (bounds, mask) void

Bounds.ts:364

Adds other Bounds, masked with Bounds.

Name Type Description
bounds PIXI.Bounds

The Bounds to be added.

mask PIXI.Bounds

TODO

addBoundsMatrix (bounds, matrix) void

Bounds.ts:391

Adds other Bounds, multiplied by matrix. Bounds shouldn't be empty.

Name Type Description
bounds PIXI.Bounds

other bounds

matrix PIXI.Matrix

multiplicator

addFrame (transform, x0, y0, x1, y1) void

Bounds.ts:186

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

addFrameMatrix (matrix, x0, y0, x1, y1) void

Bounds.ts:200

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

addFramePad (x0, y0, x1, y1, padX, padY) void

Bounds.ts:447

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

addPoint (point) void

Bounds.ts:107

This function should be inlined when its possible.

Name Type Description
point PIXI.IPointData

The point to add.

addPointMatrix (matrix, point) void

Bounds.ts:120

Adds a point, after transformed. This should be inlined when its possible.

Name Type Description
matrix PIXI.Matrix
point IPointData

addQuad (vertices) void

Bounds.ts:139

Adds a quad, not transformed

Name Type Description
vertices Float32Array

The verts to add.

addVertexData (vertexData, beginOffset, endOffset) void

Bounds.ts:258

Adds screen vertices from array

Name Type Description
vertexData Float32Array

calculated vertices

beginOffset number

begin offset

endOffset number

end offset, excluded

addVertices (transform, vertices, beginOffset, endOffset) void

Bounds.ts:289

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

addVerticesMatrix (matrix, vertices, beginOffset, endOffset, padX, padY) void

Bounds.ts:302

Add an array of mesh vertices.

Name Type Attributes Default Description
matrix PIXI.Matrix

mesh matrix

vertices Float32Array

mesh coordinates in array

beginOffset number

begin offset

endOffset number

end offset, excluded

padX number <optional>
0

x padding

padY number <optional>
0

y padding

clear () void

Bounds.ts:71

Clears the bounds and resets.

getRectangle (rect) PIXI.Rectangle

Bounds.ts:83

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

Returns:
Type Description
PIXI.Rectangle A rectangle of the bounds

isEmpty () boolean

Bounds.ts:61

Checks if bounds are empty.

Returns:
Type Description
boolean True if empty.

pad (paddingX, paddingY) void

Bounds.ts:429

Pads bounds object, making it grow in all directions. If paddingY is omitted, both paddingX and paddingY will be set to paddingX.

Name Type Attributes Default Description
paddingX number <optional>
0

The horizontal padding amount.

paddingY number <optional>
0

The vertical padding amount.