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

Memberof

PIXI

Constructors

  • Returns Bounds

Properties

maxX: number

Default

-Infinity
maxY: number

Default

-Infinity
minX: number

Default

Infinity
minY: number

Default

Infinity
rect: Rectangle
updateID: number

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

Methods

  • Adds other PIXI.Bounds.

    Parameters

    • bounds: Bounds

      The Bounds to be added

    Returns void

  • Adds other Bounds, masked with Rectangle.

    Parameters

    Returns void

  • Adds other Bounds, masked with Bounds.

    Parameters

    Returns void

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

    Parameters

    Returns void

  • Adds sprite frame, transformed.

    Parameters

    • transform: 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

    Returns void

  • Adds sprite frame, multiplied by matrix

    Parameters

    • matrix: 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

    Returns void

  • Adds padded frame. (x0, y0) should be strictly less than (x1, y1)

    Parameters

    • 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

    Returns void

  • This function should be inlined when its possible.

    Parameters

    Returns void

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

    Parameters

    Returns void

  • Adds a quad, not transformed

    Parameters

    • vertices: Float32Array

      The verts to add.

    Returns void

  • Adds screen vertices from array

    Parameters

    • vertexData: Float32Array

      calculated vertices

    • beginOffset: number

      begin offset

    • endOffset: number

      end offset, excluded

    Returns void

  • Add an array of mesh vertices

    Parameters

    • transform: Transform

      mesh transform

    • vertices: Float32Array

      mesh coordinates in array

    • beginOffset: number

      begin offset

    • endOffset: number

      end offset, excluded

    Returns void

  • Add an array of mesh vertices.

    Parameters

    • matrix: Matrix

      mesh matrix

    • vertices: Float32Array

      mesh coordinates in array

    • beginOffset: number

      begin offset

    • endOffset: number

      end offset, excluded

    • Optional padX: number

      x padding

    • Optional padY: number

      y padding

    Returns void

  • Clears the bounds and resets.

    Returns void

  • Can return Rectangle.EMPTY constant, either construct new rectangle, either use your rectangle It is not guaranteed that it will return tempRect

    Parameters

    • Optional rect: Rectangle

      Temporary object will be used if AABB is not empty

    Returns Rectangle

    • A rectangle of the bounds
  • Checks if bounds are empty.

    Returns boolean

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

    Parameters

    • Optional paddingX: number

      The horizontal padding amount.

    • Optional paddingY: number

      The vertical padding amount.

    Returns void

Generated using TypeDoc