Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Rect

Hierarchy

  • Rect

Index

Constructors

  • new Rect(x: number, y: number, w: number, h: number): Rect
  • Parameters

    • x: number

      left coordinate

    • y: number

      top coordinate

    • w: number

      width of the rectangle

    • h: number

      height of the rectangle

    Returns Rect

Properties

h: number
w: number
x: number
y: number

Accessors

  • get bottom(): number
  • set bottom(y: number): void
  • Bottom coordinate

    Returns number

  • Bottom coordinate

    Parameters

    • y: number

    Returns void

  • get bottomleft(): Vec2
  • set bottomleft(__namedParameters: Vec2): void
  • Bottom left corner coordinates Do not set the components directly, it would not update the rectangle.

    Returns Vec2

  • Bottom left corner coordinates Do not set the components directly, it would not update the rectangle.

    Parameters

    • __namedParameters: Vec2

    Returns void

  • get bottomright(): Vec2
  • set bottomright(__namedParameters: Vec2): void
  • Bottom right corner coordinates Do not set the components directly, it would not update the rectangle.

    Returns Vec2

  • Bottom right corner coordinates Do not set the components directly, it would not update the rectangle.

    Parameters

    • __namedParameters: Vec2

    Returns void

  • get center(): Vec2
  • set center(__namedParameters: Vec2): void
  • Center coordinates Do not set the components directly, it would not update the rectangle.

    Returns Vec2

  • Center coordinates Do not set the components directly, it would not update the rectangle.

    Parameters

    • __namedParameters: Vec2

    Returns void

  • get left(): number
  • set left(x: number): void
  • Left coordinate

    Returns number

  • Left coordinate

    Parameters

    • x: number

    Returns void

  • get right(): number
  • set right(x: number): void
  • right coordinate

    Returns number

  • right coordinate

    Parameters

    • x: number

    Returns void

  • get size(): Vec2
  • set size(__namedParameters: Vec2): void
  • Size as a vector. Setting this with shrink or grow the rectangle from top left corner. Do not set the components directly, it would not update the rectangle.

    Returns Vec2

  • Size as a vector. Setting this with shrink or grow the rectangle from top left corner. Do not set the components directly, it would not update the rectangle.

    Parameters

    • __namedParameters: Vec2

    Returns void

  • get top(): number
  • set top(y: number): void
  • Top coordinate

    Returns number

  • Top coordinate

    Parameters

    • y: number

    Returns void

  • get topleft(): Vec2
  • set topleft(__namedParameters: Vec2): void
  • Top left corner coordinates Do not set the components directly, it would not update the rectangle.

    Returns Vec2

  • Top left corner coordinates Do not set the components directly, it would not update the rectangle.

    Parameters

    • __namedParameters: Vec2

    Returns void

  • get topright(): Vec2
  • set topright(__namedParameters: Vec2): void
  • Top right corner coordinates Do not set the components directly, it would not update the rectangle.

    Returns Vec2

  • Top right corner coordinates Do not set the components directly, it would not update the rectangle.

    Parameters

    • __namedParameters: Vec2

    Returns void

Methods

  • from_obj(obj: Record<string, unknown>): Rect
  • Return a fresh rectangle initialized from an arbitrary object.

    Parameters

    • obj: Record<string, unknown>

    Returns Rect

  • Return a fresh null rectangle (size = Vec2.null() and topright = Vec2.null())

    Returns Rect

Generated using TypeDoc