Interface PlayerClientOptions

Options to configure PlayerClient

PlayerClientOptions

Example

const options: PlayerClientOptions = {
canvas: document.getElementById("canvas"),
width: 500,
height: 500,
modifyLocalObject: (gameObject) => {
gameObject.label = "You";
gameObject.backgroundColor = "red";
}
}

const playerClient = new PlayerClient(options);
interface PlayerClientOptions {
    canvas: HTMLCanvasElement;
    height?: number;
    modifyLocalObject: ((gameObject) => void);
    sceneOptions?: SceneOptions;
    width?: number;
}

Properties

canvas: HTMLCanvasElement

The canvas to render to

height?: number

Height of canvas (this will overwrite the canvas height)

modifyLocalObject: ((gameObject) => void)

Function to modify the local GameObject (the player, eg. change label, color, etc.)

Type declaration

    • (gameObject): void
    • Function to modify the local GameObject (the player, eg. change label, color, etc.)

      Parameters

      Returns void

sceneOptions?: SceneOptions

Options for the scene

width?: number

Width of canvas (this will overwrite the canvas width)

Generated using TypeDoc