Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Shape<T>

Type parameters

  • T

Hierarchy

  • Shape

Implemented by

Index

Properties

angle

angle: number

Rotation of Shape in radians

x

x: number

y

y: number

Methods

clone

  • clone(): T

collides

  • collides(s: Shape<any>): boolean
  • Checks if current Shape collides with another one

    Parameters

    Returns boolean

    true only if shapes collide

contains

  • contains(p: Point): boolean
  • contains(coordX: number, coordY: number): boolean
  • Checks if a point is within the bounds (inclusive) of a Shape

    Parameters

    • p: Point

      Point to check

    Returns boolean

    true only if Point is inside current Spahe

  • Checks if a point is within the bounds (inclusive) of a Shape

    Parameters

    • coordX: number

      Abscissa to check

    • coordY: number

      Ordinate to check

    Returns boolean

    true only if Point is inside current Spahe

move

  • move(newX: number, newY: number): T
  • move(vect: Vector): T
  • Translates current Shape to relative coordinates

    Parameters

    • newX: number

      Added to current abscissa

    • newY: number

      Added to current ordinate

    Returns T

    Current Shape

  • Translates current Shape to relative coordinates

    Parameters

    Returns T

    Current Shape

moveTo

  • moveTo(newX: number, newY: number): T
  • moveTo(point: Point): T
  • Translates current Shape to absolute coordinates

    Parameters

    • newX: number

      New abscissa

    • newY: number

      New ordinate

    Returns T

    Current Shape

  • Translates current Shape to absolute coordinates

    Parameters

    • point: Point

      New origin for Rectangle

    Returns T

    Current Shape

rotate

  • rotate(angle: number): T
  • Rotates shape

    Parameters

    • angle: number

      new angle for shape in degrees

    Returns T

    Current Shape

rotateRad

  • rotateRad(angle: number): T
  • Rotates shape

    Parameters

    • angle: number

      new angle for shape in radians

    Returns T

    Current Shape

scale

  • scale(ratio: number): T
  • Scales shape

    Parameters

    • ratio: number

      Scale ratio

    Returns T

    Current Shape

Generated using TypeDoc