Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Rectangle

Implements

Index

Constructors

constructor

  • new Rectangle(width?: number, height?: number, x?: number, y?: number, rot?: boolean, allowRotation?: boolean | undefined): Rectangle
  • Creates an instance of Rectangle.

    memberof

    Rectangle

    Parameters

    • Default value width: number = 0
    • Default value height: number = 0
    • Default value x: number = 0
    • Default value y: number = 0
    • Default value rot: boolean = false
    • Default value allowRotation: boolean | undefined = undefined

    Returns Rectangle

Properties

Protected _allowRotation

_allowRotation: boolean | undefined = undefined

Protected _data

_data: any

Protected _dirty

_dirty: number = 0

Protected _height

_height: number

Protected _rot

_rot: boolean = false

Protected _width

_width: number

Protected _x

_x: number

Protected _y

_y: number

oversized

oversized: boolean = false

Oversized tag on rectangle which is bigger than packer itself.

type

{boolean}

memberof

Rectangle

Accessors

allowRotation

  • get allowRotation(): boolean | undefined
  • set allowRotation(value: boolean | undefined): void
  • If the rectangle allow rotation

    type

    {boolean}

    memberof

    Rectangle

    Returns boolean | undefined

  • Set the allowRotation tag of the rectangle.

    memberof

    Rectangle

    Parameters

    • value: boolean | undefined

    Returns void

data

  • get data(): any
  • set data(value: any): void

dirty

  • get dirty(): boolean

height

  • get height(): number
  • set height(value: number): void

rot

  • get rot(): boolean
  • set rot(value: boolean): void
  • If the rectangle is rotated

    note: after rot is set, width/height of this rectangle is swaped.

    type

    {boolean}

    memberof

    Rectangle

    Returns boolean

  • Set the rotate tag of the rectangle.

    note: after rot is set, width/height of this rectangle is swaped.

    memberof

    Rectangle

    Parameters

    • value: boolean

    Returns void

width

  • get width(): number
  • set width(value: number): void

x

  • get x(): number
  • set x(value: number): void

y

  • get y(): number
  • set y(value: number): void

Methods

area

  • area(): number
  • Get the area (w * h) of the rectangle

    memberof

    Rectangle

    Returns number

collide

  • Test if the given rectangle collide with this rectangle.

    memberof

    Rectangle

    Parameters

    Returns boolean

contain

setDirty

  • setDirty(value?: boolean): void

Static Collide

Static Contain

Generated using TypeDoc