Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Rectangle

Hierarchy

Index

Constructors

constructor

  • new Rectangle(x?: number, y?: number, width?: number, height?: number): Rectangle
  • The rectangle class.

    Parameters

    • Optional x: number

      The x coordinate for the upper-left corner

    • Optional y: number

      The y coordinate for the upper-left corner

    • Optional width: number

      The width of the rectangle

    • Optional height: number

      The height of the rectangle

    Returns Rectangle

Properties

bottom

bottom: number

returns the bottom edge of the rectangle

member

{number}

height

height: number
member

{number} PIXI.Rectangle#height

default

0

left

left: number

returns the left edge of the rectangle

member

{number}

right

right: number

returns the right edge of the rectangle

member

{number}

top

top: number

returns the top edge of the rectangle

member

{number}

Readonly type

type: number

The type of the object, mainly used to avoid instanceof checks

member

{number} PIXI.Rectangle#type

readonly
default

PIXI.SHAPES.RECT

see

PIXI.SHAPES

width

width: number
member

{number} PIXI.Rectangle#width

default

0

x

x: number
member

{number} PIXI.Rectangle#x

default

0

y

y: number
member

{number} PIXI.Rectangle#y

default

0

Static EMPTY

EMPTY: Rectangle

A constant empty rectangle.

static
constant
member

{PIXI.Rectangle}

returns

An empty rectangle

Static emptyRectangle

emptyRectangle: Rectangle
static
property

emptyRectangle

Methods

ceil

  • ceil(resolution?: number, eps?: number): Rectangle

clone

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

copyTo

enlarge

fit

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.

Generated using TypeDoc