createMainWindow

View sourcecreateMainWindow(): [Window, MainWindow]

Creates the default component pair for a primary window entity.

The returned tuple is ordered [Window, MainWindow]: a fresh Window with width: 720, height: 360, and an undefined selector, followed by a fresh empty MainWindow marker. Every call constructs both objects, so component state is not shared between returned pairs.

This factory returns components; it does not spawn an entity or install the Windows resource. Pass the tuple to World#spawn or an entity command when WindowPlugin is configured with initPrimaryWindow: false. With the default configuration, the plugin creates an equivalent primary-window pair automatically.

Examples

import { createMainWindow } from '@wimaengine/window'

const components = createMainWindow()
console.log(components) // [Window, MainWindow]

Returns

Ordered pair of fresh Window and MainWindow components.