Skip to main content

Interface: GameOptions

Options to specify HTML canvas, set game canvas size, and load game assets.

Extends​

  • LocalizationOptions

Properties​

additionalTranslation?​

optional additionalTranslation: Translation

Additional translation for localization. This will typically be provided through setParameters() at runtime. This translation be merged into the existing translation and will overwrite any existing translation with the same key-value pairs. Thus, this can be used to modify an existing translation, either in whole or in part.

Inherited from​

LocalizationOptions.additionalTranslation

Defined in​

m2c2kit/packages/core/src/LocalizationOptions.ts:17


bodyBackgroundColor?​

optional bodyBackgroundColor: RgbaColor

Color of the html body, if the game does not fill the screen. Useful for showing scene boundaries. Default is the scene background color

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:52


canvasId?​

optional canvasId: string

Id of the HTML canvas that game will be drawn on. If not provided, the first canvas found will be used

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:30


dynamicSizing?​

optional dynamicSizing: boolean

Should the game dynamically resize to fit the viewport and respond to DPI changes? Default is true

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:68


fallbackLocale?​

optional fallbackLocale: string

Locale to use if requested locale translation is not available, or if "auto" locale was requested and environment cannot provide a locale. Default is en-US.

Inherited from​

LocalizationOptions.fallbackLocale

Defined in​

m2c2kit/packages/core/src/LocalizationOptions.ts:11


fonts?​

optional fonts: FontAsset[]

Font assets to use. The first element will be the default font

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:44


fpsMetricReportThreshold?​

optional fpsMetricReportThreshold: number

The FPS will be logged in game metrics if the FPS is lower than this value. Default is 59, as defined in Constants.FPS_METRIC_REPORT_THRESHOLD

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:56


height​

height: number

Height of game canvas

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:34


id​

id: string

Short identifier of this game; unique among published games and url-friendly (no spaces, special characters, or slashes).

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:18


images?​

optional images: BrowserImage[]

Array of BrowserImage objects to render and load

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:46


locale?​

optional locale: string

Locale to use for localization when running the game, or "auto" to request from the environment.

Inherited from​

LocalizationOptions.locale

Defined in​

m2c2kit/packages/core/src/LocalizationOptions.ts:9


logWebGl?​

optional logWebGl: boolean

Show logs for WebGl activity?

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:64


longDescription?​

optional longDescription: string

Full description of game

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:28


maximumRecordedActivityMetrics?​

optional maximumRecordedActivityMetrics: number

Maximum number of activity metrics to log.

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:54


missingLocalizationColor?​

optional missingLocalizationColor: RgbaColor

Font color for strings or outline color for images when a requested locale's translation or image is missing. This is useful in development to call attention to missing localization assets.

Inherited from​

LocalizationOptions.missingLocalizationColor

Defined in​

m2c2kit/packages/core/src/LocalizationOptions.ts:13


moduleMetadata?​

optional moduleMetadata: ModuleMetadata

Internal

Game's module name, version, and dependencies. For m2c2kit library use only

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:70


name​

name: string

Human-friendly name of this game

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:16


parameters?​

optional parameters: GameParameters

Default game parameters; JSON object where key is the game parameter, value is default value

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:42


publishUuid​

publishUuid: string

Persistent unique identifier (UUID) of this game; unique among published games. The m2c2kit CLI will generate this property automatically, and you should not change it. If not using the CLI, use a website like https://www.uuidgenerator.net/version4 to generate this value.

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:20


recordEvents?​

optional recordEvents: boolean

Should the game events be saved to the event store? Default is false

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:62


scoringSchema?​

optional scoringSchema: ScoringSchema

Schema of scoring data; JSON object where key is variable name, value is data type

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:40


shareAssets?​

optional shareAssets: boolean

Should games within a session share wasm and font assets that have identical filenames, in order to reduce bandwidth? Default is true.

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:66


shortDescription?​

optional shortDescription: string

Brief description of game

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:26


showEventStoreControls?​

optional showEventStoreControls: boolean

Show controls for replaying and viewing the event store? Default is false

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:60


showFps?​

optional showFps: boolean

Show FPS in upper left corner? Default is false

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:50


sounds?​

optional sounds: SoundAsset[]

Array of SoundAsset objects to fetch and decode

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:48


stretch?​

optional stretch: boolean

Stretch to fill screen? Default is false

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:36


timeStepping?​

optional timeStepping: boolean

Advance through time step-by-step, for development and debugging

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:58


translation?​

optional translation: Translation

Translation for localization.

Inherited from​

LocalizationOptions.translation

Defined in​

m2c2kit/packages/core/src/LocalizationOptions.ts:15


trialSchema?​

optional trialSchema: TrialSchema

Schema of trial data; JSON object where key is variable name, value is data type

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:38


uri?​

optional uri: string

Uri (repository, webpage, or other location where full information about the game can be found)

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:24


version​

version: string

Version of this game

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:22


width​

width: number

Width of game canvas

Defined in​

m2c2kit/packages/core/src/GameOptions.ts:32