Options
All
  • Public
  • Public/Protected
  • All
Menu

'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

Hierarchy

  • Bounds

Index

Constructors

constructor

  • Returns Bounds

Properties

maxX

maxX: number

maxY

maxY: number

minX

minX: number

minY

minY: number

rect

rect: Rectangle

updateID

updateID: number

Methods

addBounds

  • addBounds(bounds: Bounds): void
  • Adds other Bounds.

    Parameters

    • bounds: Bounds

      The Bounds to be added

    Returns void

addBoundsArea

  • Adds other Bounds, masked with Rectangle.

    Parameters

    Returns void

addBoundsMask

  • Adds other Bounds, masked with Bounds.

    Parameters

    Returns void

addBoundsMatrix

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

    Parameters

    Returns void

addFrame

  • addFrame(transform: Transform, x0: number, y0: number, x1: number, y1: number): 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

addFrameMatrix

  • addFrameMatrix(matrix: Matrix, x0: number, y0: number, x1: number, y1: number): 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

addFramePad

  • 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)

    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

addPoint

  • This function should be inlined when its possible.

    Parameters

    Returns void

addPointMatrix

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

    Parameters

    Returns void

addQuad

  • addQuad(vertices: Float32Array): void
  • Adds a quad, not transformed

    Parameters

    • vertices: Float32Array

      The verts to add.

    Returns void

addVertexData

  • addVertexData(vertexData: Float32Array, beginOffset: number, endOffset: number): void
  • Adds screen vertices from array

    Parameters

    • vertexData: Float32Array

      calculated vertices

    • beginOffset: number

      begin offset

    • endOffset: number

      end offset, excluded

    Returns void

addVertices

  • addVertices(transform: Transform, vertices: Float32Array, beginOffset: number, endOffset: number): 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

addVerticesMatrix

  • addVerticesMatrix(matrix: Matrix, vertices: Float32Array, beginOffset: number, endOffset: number, padX?: number, padY?: number): 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
    • Optional padY: number

    Returns void

clear

  • clear(): void
  • Clears the bounds and resets.

    Returns void

getRectangle

  • 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

isEmpty

  • isEmpty(): boolean
  • Checks if bounds are empty.

    Returns boolean

    True if empty.

pad

  • pad(paddingX?: number, paddingY?: number): void
  • 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
    • Optional paddingY: number

    Returns void

Generated using TypeDoc