Skip to content

KcdMp.surface

The surface this page is drawn on - or null in a frame.

On a surface page, its surface: name (the page’s name in ui.toml), id (the entity id the game mode knows it by, so the page can tell the mode which board it is - the mode’s surface callbacks are given it too) and the page’s size in pixels. Every surface the mode places with this page draws its own copy of it, so id is what tells the copies apart. id is 0 until the page is ready - read it in a handler, or after KcdMp.ready answered. null in a frame’s page and outside the game.

KcdMp.surface

KcdMpSurface | null

KcdMp.ready().then(() => {
if (KcdMp.surface) {
KcdMp.log.info(`drawn on surface ${KcdMp.surface.id} (${KcdMp.surface.name})`);
}
});

KcdMp.onSurfaceUse · KcdMp.frame · the Pages on surfaces in the world group of the index