Options
All
  • Public
  • Public/Protected
  • All
Menu

Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

memberof

PIXI

Hierarchy

Index

Constructors

constructor

  • new Rectangle(x?: number, y?: number, width?: number, height?: number): Rectangle
  • Parameters

    • Optional x: number
    • Optional y: number
    • Optional width: number
    • Optional height: number

    Returns Rectangle

Properties

height

height: number

Readonly type

type: RECT

width

width: number

x

x: number

y

y: number

Accessors

bottom

  • get bottom(): number
  • returns the bottom edge of the rectangle

    member

    {number}

    Returns number

left

  • get left(): number
  • returns the left edge of the rectangle

    member

    {number}

    Returns number

right

  • get right(): number
  • returns the right edge of the rectangle

    member

    {number}

    Returns number

top

  • get top(): number
  • returns the top edge of the rectangle

    member

    {number}

    Returns number

Static EMPTY

  • A constant empty rectangle.

    static
    constant
    member

    {PIXI.Rectangle}

    Returns Rectangle

    An empty rectangle

Methods

ceil

  • ceil(resolution?: number, eps?: number): Rectangle
  • Enlarges rectangle that way its corners lie on grid

    Parameters

    • Optional resolution: number
    • Optional eps: number

    Returns Rectangle

    Returns itself.

clone

  • Creates a clone of this Rectangle

    Returns Rectangle

    a copy of the rectangle

contains

  • contains(x: number, y: number): boolean
  • Checks whether the x and y coordinates given are contained within this Rectangle

    Parameters

    • x: number

      The X coordinate of the point to test

    • y: number

      The Y coordinate of the point to test

    Returns boolean

    Whether the x/y coordinates are within this Rectangle

copyFrom

  • Copies another rectangle to this one.

    Parameters

    • rectangle: Rectangle

      The rectangle to copy from.

    Returns Rectangle

    Returns itself.

copyTo

  • Copies this rectangle to another one.

    Parameters

    • rectangle: Rectangle

      The rectangle to copy to.

    Returns Rectangle

    Returns given parameter.

enlarge

  • Enlarges this rectangle to include the passed rectangle.

    Parameters

    • rectangle: Rectangle

      The rectangle to include.

    Returns Rectangle

    Returns itself.

fit

  • Fits this rectangle around the passed one.

    Parameters

    Returns Rectangle

    Returns itself.

pad

  • pad(paddingX?: number, paddingY?: number): Rectangle
  • Pads the rectangle 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 Rectangle

    Returns itself.

toString

  • toString(): string
  • Returns string

Generated using TypeDoc