Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Config

Index

Properties

Optional background

background?: string
memberof

Duck.Types.Game.Config

description

CSS background color of the canvas (hint: to fill a scene with a background color, use scene.add.misc.canvasModulate)

default

undefined

since

1.0.0-beta

Optional blur

blur?: boolean
memberof

Duck.Types.Game.Config

description

Determines if window.blur is called on load or not

default

false

since

2.0.0

canvas

canvas: HTMLCanvasElement | { canvas: HTMLCanvasElement; ctx: CanvasRenderingContext2D }
memberof

Duck.Types.Game.Config

description

Canvas element to render to or return value from Duck.AutoCanvas()

since

1.0.0-beta

Optional debug

debug?: boolean
memberof

Duck.Types.Game.Config

description

Determines if DuckEngine logs out events that are occurring

default

false

since

1.0.0-beta

Optional debugRendering

debugRendering?: boolean
memberof

Duck.Types.Game.Config

description

Determines if DuckEngine silences/prevents pauseRenderingOnBlur, onPauseRendering, and onResumeRendering configurations

default

false

since

2.0.0

defaultScene

defaultScene: string
memberof

Duck.Types.Game.Config

description

Key of scene that is defaulted to be visible

since

1.0.0-beta

Optional dprScale

dprScale?: boolean
memberof

Duck.Types.Game.Config

description

Uses the device pixel ratio to scale the canvas accordingly

default

false

since

1.0.0

Optional focus

focus?: boolean
memberof

Duck.Types.Game.Config

description

Determines if window.focus is called on load or not

default

false

since

2.0.0

Optional pauseRenderingOnBlur

pauseRenderingOnBlur?: boolean
memberof

Duck.Types.Game.Config

description

Determines if rendering renderable objects is paused if tab is not focused, uses window.onblur and window.onfocus

default

false

since

2.0.0

Optional physics

physics?: { customTick?: boolean; debug?: boolean; enabled: boolean; gravity?: Vector2Like }
memberof

Duck.Types.Game.Config

description

Physics Options

since

2.0.0

Type declaration

  • Optional customTick?: boolean
  • Optional debug?: boolean
  • enabled: boolean
  • Optional gravity?: Vector2Like

Optional poolingInterval

poolingInterval?: number
memberof

Duck.Types.Game.Config

description

How often, in milliseconds, the RendererPipeline calls its pool method, affects how long it takes for a scene or renderable to change its visibility as both are controlled and updated by the RendererPipeline

default

1000

since

2.1.0

Optional roundPixels

roundPixels?: boolean
memberof

Duck.Types.Game.Config

description

Rounds pixels from floats to integers, affects gameobjects (excluding particles)

default

false

since

2.0.0

Optional scale

scale?: Vector2Like
memberof

Duck.Types.Game.Config

description

Scale of the canvas, the size of the canvas

since

2.1.0

Optional smartScale

smartScale?: boolean
memberof

Duck.Types.Game.Config

description

Determines if the canvas is scaled down to the window size if the window size is smaller than the canvas

default

false

since

1.0.0

Optional splashScreen

splashScreen?: { extraDuration?: number; img?: string }
memberof

Duck.Types.Game.Config

description

Custom splash screen options, shows while the game is starting/loading, default img: https://i.ibb.co/bdN4CCN/Logo-Splash.png default extraDuration: 500

since

2.0.0

Type declaration

  • Optional extraDuration?: number
  • Optional img?: string

Methods

Optional onPauseRendering

  • onPauseRendering(reason: "windowBlur" | "gameStop" | "gameConfigBlur"): void
  • memberof

    Duck.Types.Game.Config

    description

    Function to call when rendering is paused, rendering pauses when this.stop is called or if pauseRenderingOnBlur is true and the window.blur event was fired

    since

    2.0.0

    Parameters

    • reason: "windowBlur" | "gameStop" | "gameConfigBlur"

    Returns void

Optional onResumeRendering

  • onResumeRendering(reason: "windowFocus" | "gameStart" | "gameConfigFocus"): void
  • memberof

    Duck.Types.Game.Config

    description

    Function to call when rendering is resumed/started, rendering resumes/starts when this.start is called or if the window.focus event was fired

    since

    2.0.0

    Parameters

    • reason: "windowFocus" | "gameStart" | "gameConfigFocus"

    Returns void

Generated using TypeDoc