Skip to main content

Flags

Flags is a feature flag implementation for Excalibur. They can only be operated before Engine construction after which they are frozen and are read-only.

Flags are used to enable experimental or preview features in Excalibur.

Index

Constructors

constructor

Methods

publicstaticdisable

  • disable(flagName: string): void
  • Disable a specific feature flag by name. Note: can only be set before Engine constructor time


    Parameters

    • flagName: string

    Returns void

publicstaticenable

  • enable(flagName: string): void
  • Enable a specific feature flag by name. Note: can only be set before Engine constructor time


    Parameters

    • flagName: string

    Returns void

publicstaticfreeze

  • freeze(): void
  • Freeze all flag modifications making them readonly


    Returns void

publicstaticisEnabled

  • isEnabled(flagName: string): boolean
  • Check if a flag is enabled. If the flag is disabled or does not exist false is returned


    Parameters

    • flagName: string

    Returns boolean

publicstaticshow

  • show(): string[]
  • Show a list of currently known flags


    Returns string[]

publicstaticuseCanvasGraphicsContext

  • useCanvasGraphicsContext(): void
  • Force excalibur to load the Canvas 2D graphics context fallback

    @warning

    not all features of excalibur are supported in the Canvas 2D fallback


    Returns void

publicstaticuseLegacyImageRenderer

  • useLegacyImageRenderer(): void
  • Force excalibur to use the less optimized image renderer


    Returns void