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.

    class

    Rectangle

    constructor

    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

height

height: number

The height of the rectangle.

property

height

type

Number

left

left: number

right

right: number

top

top: number

type

type: number

width

width: number

The width of the rectangle.

property

width

type

Number

x

x: number

The x coordinate for the upper-left corner.

property

x

type

Number

y

y: number

The y coordinate for the upper-left corner.

property

y

type

Number

Static EMPTY

EMPTY: Rectangle

Static emptyRectangle

emptyRectangle: Rectangle
static
property

emptyRectangle

type

Rectangle

Methods

clone

contains

  • contains(x: number, y: number): boolean
  • Parameters

    • x: number
    • y: number

    Returns boolean

copy

enlarge

  • Parameters

    Returns void

fit

  • Parameters

    Returns void

pad

  • pad(paddingX: number, paddingY: number): void
  • Parameters

    • paddingX: number
    • paddingY: number

    Returns void

Generated using TypeDoc