Options
All
  • Public
  • Public/Protected
  • All
Menu

Excalibur.js Edge API Documentation

Index

References

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

References

Re-exports PointerComponent
Re-exports PointerSystem

Type aliases

AnimationEvents: { ended: Animation; frame: Frame; loop: Animation }

Type declaration

ComponentCtor<T>: new (...args: any[]) => T

Type parameters

Type declaration

    • new (...args: any[]): T
    • Component Contructor Types

      Parameters

      • Rest ...args: any[]

      Returns T

ComponentStringType<T>: T extends Component<infer R> ? R : string

Plucks the string type out of a component type

Type parameters

  • T

ComponentType<ComponentToParse>: ComponentToParse extends Component<infer TypeName> ? TypeName : never

Type parameters

  • ComponentToParse

Constructor<T>: {}

Type parameters

  • T

Type declaration

    DestinationSize: { height: number; width: number }

    Type declaration

    • height: number
    • width: number
    ExResponseType: "" | "arraybuffer" | "blob" | "document" | "json" | "text"
    HTMLImageSource: HTMLImageElement | HTMLCanvasElement
    Id<T>: { type: T; value: number }

    Type parameters

    • T: string

    Type declaration

    • type: T
    • value: number
    MaybeObserver<T>: Partial<Util.Observer<T>>

    Defines an interface for something that might be an observer if a notify() is present

    Type parameters

    • T

    SourceView: { height: number; width: number; x: number; y: number }

    Type declaration

    • height: number
    • width: number
    • x: number
    • y: number
    SystemTypes<ComponentTypes>: ComponentTypes extends Component<infer TypeName> ? TypeName : never

    Type parameters

    • ComponentTypes

    UniformTypeNames: "uniform1f" | "uniform1i" | "uniform2f" | "uniform2i" | "uniform3f" | "uniform3i" | "uniform4f" | "uniform4i" | "uniform1fv" | "uniform1iv" | "uniform2fv" | "uniform2iv" | "uniform3fv" | "uniform3iv" | "uniform4fv" | "uniform4iv" | "uniformMatrix2fv" | "uniformMatrix3fv" | "uniformMatrix4fv"
    activate: "activate"
    axis: "axis"
    button: "button"
    cancel: "cancel"
    collisionend: "collisionend"
    collisionstart: "collisionstart"
    connect: "connect"
    deactivate: "deactivate"
    disconnect: "disconnect"
    down: "down"
    enter: "enter"
    entertrigger: "enter"
    enterviewport: "enterviewport"
    exittrigger: "exit"
    exitviewport: "exitviewport"
    hidden: "hidden"
    hold: "hold"
    initialize: "initialize"
    kill: "kill"
    leave: "leave"
    move: "move"
    pointercancel: "pointercancel"
    pointerdown: "pointerdown"
    pointerdragend: "pointerdragend"
    pointerdragenter: "pointerdragenter"
    pointerdragleave: "pointerdragleave"
    pointerdragmove: "pointerdragmove"
    pointerdragstart: "pointerdragstart"
    pointerenter: "pointerenter"
    pointerleave: "pointerleave"
    pointermove: "pointermove"
    pointerup: "pointerup"
    pointerwheel: "pointerwheel"
    postcollision: "postcollision"
    postdebugdraw: "postdebugdraw"
    postdraw: "postdraw"
    postframe: "postframe"
    postkill: "postkill"
    postupdate: "postupdate"
    precollision: "precollision"
    predebugdraw: "predebugdraw"
    predraw: "predraw"
    preframe: "preframe"
    prekill: "prekill"
    press: "press"
    preupdate: "preupdate"
    release: "release"
    start: "start"
    stop: "stop"
    subscribe: "subscribe"
    unsubscribe: "unsubscribe"
    up: "up"
    visible: "visible"
    wheel: "wheel"

    Variables

    ClosestLineJumpTable: { CircleCircleClosestLine: any; CircleEdgeClosestLine: any; EdgeEdgeClosestLine: any; PolygonCircleClosestLine: any; PolygonEdgeClosestLine: any; PolygonPolygonClosestLine: any } = ...

    Type declaration

    CollisionJumpTable: { CollideCircleCircle: any; CollideCircleEdge: any; CollideCirclePolygon: any; CollideEdgeEdge: any; CollidePolygonEdge: any; CollidePolygonPolygon: any; FindContactSeparation: any } = ...

    Type declaration

    EX_VERSION: string = process.env.__EX_VERSION

    The current Excalibur version string

    description

    process.env.__EX_VERSION gets replaced by Webpack on build

    TwoPI: number = ...

    Two PI constant

    maxMessages: 5 = 5

    Functions

    • Finds the closes line between 2 line segments, were the magnitude of u, v are the lengths of each segment L1 = P(s) = p0 + s * u, where s is time and p0 is the start of the line L2 = Q(t) = q0 + t * v, where t is time and q0 is the start of the line

      Parameters

      • p0: Vector

        Point where L1 begins

      • u: Vector

        Direction and length of L1

      • q0: Vector

        Point were L2 begins

      • v: Vector

        Direction and length of L2

      Returns LineSegment

    • Configurable<T>(base: T): T
    • Configurable helper extends base type and makes all properties available as option bag arguments

      internal

      Type parameters

      Parameters

      • base: T

      Returns T

    • canonicalizeAngle(angle: number): number
    • Convert an angle to be the equivalent in the range [0, 2PI]

      Parameters

      • angle: number

      Returns number

    • clamp(val: number, min: number, max: number): number
    • Clamps a value between a min and max inclusive

      Parameters

      • val: number
      • min: number
      • max: number

      Returns number

    • createId<T>(type: T, value: number): Id<T>
    • Create a branded ID type from a number

      Type parameters

      • T: string

      Parameters

      • type: T
      • value: number

      Returns Id<T>

    • frac(x: number): number
    • Returns the fractional part of a number

      Parameters

      • x: number

      Returns number

    • isScreenElement(actor: Actor): boolean
    • randomInRange(min: number, max: number, random?: Random): number
    • Find a random floating point number in range

      Parameters

      • min: number
      • max: number
      • random: Random = ...

      Returns number

    • randomIntInRange(min: number, max: number, random?: Random): number
    • Find a random integer in a range

      Parameters

      • min: number
      • max: number
      • random: Random = ...

      Returns number

    • range(from: number, to: number): number[]
    • Generate a range of numbers For example: range(0, 5) -> [0, 1, 2, 3, 4, 5]

      Parameters

      • from: number

        inclusive

      • to: number

        inclusive

      Returns number[]

    • resetObsoleteCounter(): void
    • sign(val: number): number
    • Returns the sign of a number, if 0 returns 0

      Parameters

      • val: number

      Returns number

    • toDegrees(radians: number): number
    • Convert radians to degrees

      Parameters

      • radians: number

      Returns number

    • toRadians(degrees: number): number
    • Convert degrees to radians

      Parameters

      • degrees: number

      Returns number

    • vec(x: number, y: number): Vector
    • Shorthand for creating new Vectors - returns a new Vector instance with the provided X and Y components.

      Parameters

      • x: number

        X component of the Vector

      • y: number

        Y component of the Vector

      Returns Vector