Skip to content

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.

SymbolSummary
SceneWindowLayerclass. 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 IFocusGroup

Connects 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: WindowManager

Persistent 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 plain new WindowManager().
  • keyboardHandler: Optional (window, input) => boolean handler for a focused window group.
  • widgetFocus: Optional WillowUI FocusManager used for widget focus inside the selected window.
ts
sceneWindows(scene: any): WindowManager

Returns 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): Window

Adds 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): Window

Adds a persistent WillowUI window above the complete scene stack.

  • window: WillowUI window to add.
  • Returns: The supplied window.
ts
closeWindow(window: Window): boolean

Removes 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 | null

Returns the focused WillowUI window, or null while the scene owns focus.

ts
get isFocused(): boolean

Reports whether a window layer, rather than the top scene, owns focus.

ts
activateFocus(): void

Resolves the highest-priority window group and gives it focus when one exists.

ts
blur(): void

Clears focus from every WindowManager while retaining all layer membership.

ts
clickWindow(window: Window): void

Focuses 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(): void

Returns focus to the top scene and blurs all floating windows.

ts
handleInput(input: any): boolean

Offers 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): boolean

Convenience alias for offering keyboard input to the resolved application focus group.

  • input: Caller-defined keyboard value.
  • Returns: True when handled.
ts
dispose(): void

Releases observer registration and removes all windows from GameKit-owned managers.