ui family
Scene windows and screen windows on willowui.
Import these from gamekit/src/ui (a few are also re-exported by the package root, as noted on each).
1 symbols, 0 of them also in the package root.
| Symbol | Summary |
|---|---|
SceneWindowLayer | class. Connects one WillowUI WindowManager to each scene and one persistent manager to the screen. |
SceneWindowLayer
ts
import { SceneWindowLayer } from "gamekit/src/ui";
class SceneWindowLayer implements IFocusGroupConnects one WillowUI WindowManager to each scene and one persistent manager to the screen. WillowUI retains window ordering, modal overlays, dragging, suspension, and widget focus; GameKit supplies scene ownership and application focus resolution.
Members
ts
readonly screenWindows: WindowManagerPersistent windows drawn above the complete scene stack.
ts
constructor(scenes: SceneStack, createManager: (() => WindowManager) | null = null, keyboardHandler: ((window: Window, input: any) => boolean) | null = null, widgetFocus: FocusManager | null = null)Creates scene-owned and screen-owned WillowUI window layers over one scene stack.
scenes: Sole scene stack whose cover, resume, and exit lifecycle is observed.createManager: Optional factory returning a WillowUI WindowManager; omitted, each layer gets a plainnew WindowManager().keyboardHandler: Optional(window, input) => booleanhandler for a focused window group.widgetFocus: Optional WillowUI FocusManager used for widget focus inside the selected window.
ts
sceneWindows(scene: any): WindowManagerReturns the WillowUI manager owned by one scene, creating its empty layer when first requested.
scene: Scene that owns the layer.- Returns: Per-scene WillowUI WindowManager.
ts
openSceneWindow(scene: any, window: Window): WindowAdds a WillowUI window to its owning scene layer. Floating windows start unfocused; a modal focuses automatically through WillowUI and the resolver.
scene: Active or covered scene that owns the window.window: WillowUI window to add.- Returns: The supplied window.
ts
openScreenWindow(window: Window): WindowAdds a persistent WillowUI window above the complete scene stack.
window: WillowUI window to add.- Returns: The supplied window.
ts
closeWindow(window: Window): booleanRemoves a window from whichever GameKit layer owns it without disposing the WillowUI object.
window: Window to detach from its manager.- Returns: True when a layer owned the window.
ts
get focusedWindow(): Window | nullReturns the focused WillowUI window, or null while the scene owns focus.
ts
get isFocused(): booleanReports whether a window layer, rather than the top scene, owns focus.
ts
activateFocus(): voidResolves the highest-priority window group and gives it focus when one exists.
ts
blur(): voidClears focus from every WindowManager while retaining all layer membership.
ts
clickWindow(window: Window): voidFocuses a floating or modal window after pointer interaction.
window: Window clicked by the user.- Throws: Error when the window does not belong to this layer.
ts
clickScene(): voidReturns focus to the top scene and blurs all floating windows.
ts
handleInput(input: any): booleanOffers keyboard input to the focused window or, when none is focused, the top scene.
input: Caller-defined keyboard value.- Returns: True when the selected focus group handled the value.
ts
dispatchKeyboard(input: any): booleanConvenience alias for offering keyboard input to the resolved application focus group.
input: Caller-defined keyboard value.- Returns: True when handled.
ts
dispose(): voidReleases observer registration and removes all windows from GameKit-owned managers.