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

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

GameOptions.ts:49


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

GameOptions.ts:29


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

LocalizationOptions.ts:11


fonts?

optional fonts: FontAsset[]

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

Defined in

GameOptions.ts:41


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

GameOptions.ts:53


height

height: number

Height of game canvas

Defined in

GameOptions.ts:33


id

id: string

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

Defined in

GameOptions.ts:17


images?

optional images: BrowserImage[]

Array of BrowserImage objects to render and load

Defined in

GameOptions.ts:43


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

LocalizationOptions.ts:9


logWebGl?

optional logWebGl: boolean

Show logs for WebGl activity?

Defined in

GameOptions.ts:61


longDescription?

optional longDescription: string

Full description of game

Defined in

GameOptions.ts:27


maximumRecordedActivityMetrics?

optional maximumRecordedActivityMetrics: number

Maximum number of activity metrics to log.

Defined in

GameOptions.ts:51


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

LocalizationOptions.ts:13


moduleMetadata?

optional moduleMetadata: ModuleMetadata

Internal

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

Defined in

GameOptions.ts:65


name

name: string

Human-friendly name of this game

Defined in

GameOptions.ts:15


parameters?

optional parameters: GameParameters

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

Defined in

GameOptions.ts:39


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

GameOptions.ts:19


recordEvents?

optional recordEvents: boolean

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

Defined in

GameOptions.ts:59


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

GameOptions.ts:63


shortDescription?

optional shortDescription: string

Brief description of game

Defined in

GameOptions.ts:25


showEventStoreControls?

optional showEventStoreControls: boolean

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

Defined in

GameOptions.ts:57


showFps?

optional showFps: boolean

Show FPS in upper left corner? Default is false

Defined in

GameOptions.ts:47


sounds?

optional sounds: SoundAsset[]

Array of SoundAsset objects to fetch and decode

Defined in

GameOptions.ts:45


stretch?

optional stretch: boolean

Stretch to fill screen? Default is false

Defined in

GameOptions.ts:35


timeStepping?

optional timeStepping: boolean

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

Defined in

GameOptions.ts:55


translation?

optional translation: Translation

Translation for localization.

Inherited from

LocalizationOptions.translation

Defined in

LocalizationOptions.ts:15


trialSchema?

optional trialSchema: TrialSchema

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

Defined in

GameOptions.ts:37


uri?

optional uri: string

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

Defined in

GameOptions.ts:23


version

version: string

Version of this game

Defined in

GameOptions.ts:21


width

width: number

Width of game canvas

Defined in

GameOptions.ts:31