Options
All
  • Public
  • Public/Protected
  • All
Menu

Excalibur helper for defining colliders quickly

Hierarchy

  • Shape

Index

Constructors

Methods

  • Creates a box collider, under the hood defines a PolygonCollider collider

    Parameters

    • width: number

      Width of the box

    • height: number

      Height of the box

    • anchor: Vector = Vector.Half

      Anchor of the box (default (.5, .5)) which positions the box relative to the center of the collider's position

    • offset: Vector = Vector.Zero

      Optional offset relative to the collider in local coordinates

    Returns PolygonCollider

  • Creates a new circle collider

    Circle colliders are useful for balls, or to make collisions more forgiving on sharp edges

    Parameters

    • radius: number

      Radius of the circle collider

    • offset: Vector = Vector.Zero

      Optional offset relative to the collider in local coordinates

    Returns CircleCollider

  • Creates a new edge collider

    Edge colliders are useful for floors, walls, and other barriers

    Parameters

    • begin: Vector

      Beginning of the edge in local coordinates to the collider

    • end: Vector

      Ending of the edge in local coordinates to the collider

    Returns EdgeCollider