• Public
  • Public/Protected
  • All

Interface EngineOptions

Defines the available options to configure the Excalibur engine at constructor time.


  • EngineOptions



Optional antialiasing

antialiasing: boolean

Optionally specify antialiasing (smoothing), by default true (smooth pixels)

Optional backgroundColor

backgroundColor: Color

Optionally set the background color

Optional canvasElement

canvasElement: HTMLCanvasElement

Optionally specify the target canvas DOM element directly

Optional canvasElementId

canvasElementId: string

Optionally specify the target canvas DOM element to render the game in

Optional displayMode

displayMode: DisplayMode

The DisplayMode of the game. Depending on this value, width and height may be ignored.

Optional enableCanvasTransparency

enableCanvasTransparency: boolean

Optionally configure the native canvas transparent backdrop

Optional height

height: number

Optionally configure the height of the viewport in css pixels

Optional pointerScope

pointerScope: PointerScope

Configures the pointer scope. Pointers scoped to the 'Canvas' can only fire events within the canvas viewport; whereas, 'Document' (default) scoped will fire anywhere on the page.

Optional position

position: string | AbsolutePosition

Specify how the game window is to be positioned when the DisplayMode.Position is chosen. This option MUST be specified if the DisplayMode is set as DisplayMode.Position. The position can be either a string or an AbsolutePosition. String must be in the format of css style background-position. The vertical position must precede the horizontal position in strings.

Valid String examples: "top left", "top", "bottom", "middle", "middle center", "bottom right" Valid AbsolutePosition examples: {top: 5, right: 10%}, {bottom: 49em, left: 10px}, {left: 10, bottom: 40}

Optional resolution

resolution: ScreenDimension

Optionally specify the size the logical pixel resolution, if not specified it will be width x height. See Resolution for common presets.

Optional scrollPreventionMode

scrollPreventionMode: ScrollPreventionMode

Scroll prevention method.

Optional suppressConsoleBootMessage

suppressConsoleBootMessage: boolean

Suppress boot up console message, which contains the "powered by Excalibur message"

Optional suppressHiDPIScaling

suppressHiDPIScaling: boolean

Suppress HiDPI auto detection and scaling, it is not recommended users of excalibur switch off this feature. This feature detects and scales the drawing canvas appropriately to accommodate HiDPI screens.

Optional suppressMinimumBrowserFeatureDetection

suppressMinimumBrowserFeatureDetection: boolean

Suppress minimum browser feature detection, it is not recommended users of excalibur switch this off. This feature ensures that the currently running browser meets the minimum requirements for running excalibur. This can be useful if running on non-standard browsers or if there is a bug in excalibur preventing execution.

Optional suppressPlayButton

suppressPlayButton: boolean

Suppress play button, it is not recommended users of excalibur switch this feature. Some browsers require a user gesture (like a click) for certain browser features to work like web audio.

Optional viewport

viewport: ScreenDimension

Optionally configure the width & height of the viewport in css pixels. Use viewport instead of EngineOptions.width and EngineOptions.height, or vice versa.

Optional width

width: number

Optionally configure the width of the viewport in css pixels