Class
MainWindow
View sourceMarks the entity that represents the primary window.
MainWindow is an empty component marker. With the default
WindowPlugin configuration, the primary-window entity contains
both Window and MainWindow. The primaryWindowOptions
passed to the plugin configure that entity’s Window component;
MainWindow has no dimensions, canvas reference, or other state of
its own.
Query this marker with the entity handle to find the primary-window entity.
A query such as [EntityHandle, Window, MainWindow] provides the handle for
looking up the canvas in the Windows resource and the associated Window
component. If initPrimaryWindow is false, WindowPlugin does
not create this entity; callers can create their own entity with
new MainWindow() or use createMainWindow for the default
[Window, MainWindow] pair.
Examples
import { EntityHandle, Query } from '@wimaengine/ecs'
import { MainWindow } from '@wimaengine/window'
const match = new Query(world, [EntityHandle, MainWindow]).single()
const primaryEntity = match?.[0]
if (primaryEntity) {
console.log('primary window entity', primaryEntity)
}Constructor
Methods
staticdefault(): MainWindow
View sourcestaticcopy(source: MainWindow, target?: MainWindow): MainWindow
View sourceCopies an empty marker into the target component.
MainWindow has no fields, so source is not read. When target is
omitted, a new marker is returned; otherwise the same target is returned
unchanged.
staticclone(target: MainWindow): MainWindow
View sourceCreates a new empty marker.
This delegates to MainWindow.copy without a target, so the result
is a new MainWindow instance.
staticserialize(_value: MainWindow): object
View sourceSerializes the marker as an empty object.
There is no marker state to persist.
staticdeserialize(_value: unknown, out?: MainWindow): MainWindow
View sourceDeserializes the marker without reading serialized data.
Since the serialized representation is empty, this returns the supplied
output marker or creates a new one when out is omitted.
