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

Source

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

Source

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

Source

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

Source

LocalizationOptions.ts:11


fonts?

optional fonts: FontAsset[]

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

Source

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

Source

GameOptions.ts:53


height

height: number

Height of game canvas

Source

GameOptions.ts:33


id

id: string

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

Source

GameOptions.ts:17


images?

optional images: BrowserImage[]

Array of BrowserImage objects to render and load

Source

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

Source

LocalizationOptions.ts:9


logWebGl?

optional logWebGl: boolean

Show logs for WebGl activity?

Source

GameOptions.ts:61


longDescription?

optional longDescription: string

Full description of game

Source

GameOptions.ts:27


maximumRecordedActivityMetrics?

optional maximumRecordedActivityMetrics: number

Maximum number of activity metrics to log.

Source

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

Source

LocalizationOptions.ts:13


moduleMetadata?

Internal

optional moduleMetadata: ModuleMetadata

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

Source

GameOptions.ts:65


name

name: string

Human-friendly name of this game

Source

GameOptions.ts:15


parameters?

optional parameters: GameParameters

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

Source

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.

Source

GameOptions.ts:19


recordEvents?

optional recordEvents: boolean

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

Source

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.

Source

GameOptions.ts:63


shortDescription?

optional shortDescription: string

Brief description of game

Source

GameOptions.ts:25


showEventStoreControls?

optional showEventStoreControls: boolean

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

Source

GameOptions.ts:57


showFps?

optional showFps: boolean

Show FPS in upper left corner? Default is false

Source

GameOptions.ts:47


sounds?

optional sounds: SoundAsset[]

Array of SoundAsset objects to fetch and decode

Source

GameOptions.ts:45


stretch?

optional stretch: boolean

Stretch to fill screen? Default is false

Source

GameOptions.ts:35


timeStepping?

optional timeStepping: boolean

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

Source

GameOptions.ts:55


translation?

optional translation: Translation

Translation for localization.

Inherited from

LocalizationOptions.translation

Source

LocalizationOptions.ts:15


trialSchema?

optional trialSchema: TrialSchema

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

Source

GameOptions.ts:37


uri?

optional uri: string

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

Source

GameOptions.ts:23


version

version: string

Version of this game

Source

GameOptions.ts:21


width

width: number

Width of game canvas

Source

GameOptions.ts:31