Options
All
  • Public
  • Public/Protected
  • All
Menu

Excalibur shape helper for defining collision shapes quickly

Hierarchy

  • Shape

Index

Methods

Static Box

  • Creates a box collision shape, under the hood defines a ConvexPolygon collision shape

    Parameters

    • width: number

      Width of the box

    • height: number

      Height of the box

    • Default value anchor: Vector = Vector.Half

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

    • Default value offset: Vector = Vector.Zero

      Optional offset relative to the collider in local coordinates

    Returns ConvexPolygon

Static Circle

  • Creates a new Circle collision shape

    Parameters

    • radius: number

      Radius of the circle shape

    • Default value offset: Vector = Vector.Zero

      Optional offset relative to the collider in local coordinates

    Returns Circle

Static Edge

Static Polygon

  • Creates a new arbitrary polygon collision shape

    Parameters

    • points: Vector[]

      Points specified in counter clockwise

    • Default value clockwiseWinding: boolean = false

      Optionally changed the winding of points, by default false meaning counter-clockwise winding.

    • Default value offset: Vector = Vector.Zero

      Optional offset relative to the collider in local coordinates

    Returns ConvexPolygon