Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Utils

Index

Constructors

constructor

Methods

Static checkCollision

  • checkCollision(x1: number, y1: number, width1: number, height1: number, x2: number, y2: number, width2: number, height2: number): boolean
  • Return whether two boxes collide.

    Parameters

    • x1: number

      The X coordinate top left corner of box 1.

    • y1: number

      The y coordinate top left corner of box 1.

    • width1: number

      The width of box 1.

    • height1: number

      The X height of box 1.

    • x2: number

      The X coordinate top left corner of box 2.

    • y2: number

      The y coordinate top left corner of box 2.

    • width2: number

      The width of box 2.

    • height2: number

      The X height of box 2.

    Returns boolean

    Returns true if boxes overlap, false if they only touch or are disjoint.

Static degreesToRadians

  • degreesToRadians(degrees: number): number
  • Return the degree value converted to radians.

    Parameters

    • degrees: number

      The value in degrees.

    Returns number

    The value in radians.

Static isFunction

  • isFunction(callback: any): boolean
  • Check whether the argument is a function.

    Parameters

    • callback: any

      The object to check.

    Returns boolean

    true if it is a function, false otherwise.

Static isNullOrUndefined

  • isNullOrUndefined(value?: any): boolean
  • Return whether the value is null or undefined.

    Parameters

    • Optional value: any

      The value to test.

    Returns boolean

    True if the value is null or undefined; false otherwise.

Generated using TypeDoc