Skip to main content

Game Config

Simple example to show what can be configured. This example shows 100% container width with fixed 4:3 ratio and rendering at 400x300. It also shows how to configure the colors for the loading screen and clear color.

const config = {
states: { game: BoxState },
defaultState: 'game',
rendering: {
clearColor: { r: 0.2, g: 0.1, b: 0.1, a: 1 },
},
};

new TEngine(config, self as DedicatedWorkerGlobalScope);