app family
Scenes, the scene stack and coordinator, screen layers, focus groups, and input actions, routing and replay.
Every symbol on this page is exported from the package root: import { Name } from "gamekit";
22 symbols.
| Symbol | Summary |
|---|---|
ActionFrame | class. Immutable-by-interface snapshot of named logical action states for one application frame. |
ActionState | class. Complete logical state of one action for a single frame, including edges, repeat, and analog magnitude. |
AppRegistration | class. Disposable token for one coordinator or scene-stack registration. |
AppScene | class. Base scene with asynchronous lifecycle hooks, focus state, and operation input gating. |
AppState | enum. Coarse coordinator phases reported to application observers. |
FocusGroup | class. Supplies the default focus bookkeeping for scenes and non-UI focus groups. |
FocusGroupResolver | class. Resolves one focused application group from screen windows, scene windows, and the top scene. |
IFocusGroup | interface. Defines an application-level focus boundary shared by scenes and window layers. |
InputContext | class. Named routing layer that declares exactly which logical actions it can receive. |
InputContextKind | enum. Describes the game layer receiving routed actions; routing precedence still follows context stack order, not this label. |
InputPolicy | class. Builds edge-aware logical action frames by asking the core InputMap about the actions in play. |
InputRecorder | class. Accumulates detached action frames for deterministic replay. |
InputRecording | class. Immutable-by-interface sequence of copied logical action frames. |
InputReplay | class. Forward-only cursor over an isolated copy of an input recording. |
InputRouter | class. Routes logical actions through an explicit context stack while preserving press-to-release ownership. |
InputSample | class. Normalized state of one physical control during a presentation frame. |
RoutedInput | class. Per-context action-frame result produced by one InputRouter.route call. |
SceneCoordinator | class. Coordinates the application's sole scene stack with scene-scoped clocks, input contexts, assets, saves, and coarse state. |
SceneOperation | class. Identifies one scene-stack mutation and lets newer work invalidate stale asynchronous completion. |
SceneStack | class. Owns a game's asynchronous scene stack and keeps focus and input on only its ready top scene. |
ScreenLayers | class. The two GameKit containers on Willow's screen-space root (engine.screen2d, meta-thicket scenes.md problem 10). |
TickInput | class. Turns one InputPolicy frame per simulation tick into a frame a fixed-step game can consume without losing taps. |
ActionFrame
ts
import { ActionFrame } from "gamekit";
class ActionFrameImmutable-by-interface snapshot of named logical action states for one application frame. Missing actions read as inactive, and returned states are copies so recordings cannot be mutated indirectly.
Members
ts
constructor(states: ActionState[] = [])Copies action states into a new frame.
states: Logical states to retain in their supplied order.
ts
held(action: string): booleanTests whether an action is continuously active in this frame.
action: Logical action name; unknown names are inactive.
ts
pressed(action: string): booleanTests whether an action changed from inactive to active in this frame.
action: Logical action name; unknown names are not pressed.
ts
released(action: string): booleanTests whether an action changed from active to inactive in this frame.
action: Logical action name; unknown names are not released.
ts
repeated(action: string): booleanTests whether the physical source reported an explicit repeat for this action.
action: Logical action name; unknown names are not repeated.
ts
axis(action: string): floatReads the strongest qualifying analog value selected for an action.
action: Logical action name; unknown or digital-only names return zero.
ts
actions(): ActionState[]Returns detached state copies in action-map order.
ts
copy(): ActionFrameClones the frame and every contained action state for independent retention.
ActionState
ts
import { ActionState } from "gamekit";
class ActionStateComplete logical state of one action for a single frame, including edges, repeat, and analog magnitude.
Members
ts
action: stringLogical action name, independent of any device control.
ts
held: booleanWhether the action is active throughout this frame.
ts
pressed: booleanWhether this frame contains the inactive-to-active edge.
ts
released: booleanWhether this frame contains the active-to-inactive edge.
ts
repeated: booleanWhether an active source emitted an explicit repeat in this frame.
ts
axis: floatSigned analog magnitude, or zero when no axis binding qualifies.
ts
constructor(action: string, held: boolean, pressed: boolean, released: boolean, repeated: boolean, axis: float)Captures one already-resolved action state without further normalization.
action: Name associated with these resolved flags.held: Continuous active flag.pressed: Activation-edge flag.released: Deactivation-edge flag.repeated: Source repeat flag.axis: Signed analog magnitude.
ts
copy(): ActionStateReturns an independent state object with the same scalar fields.
AppRegistration
ts
import { AppRegistration } from "gamekit";
class AppRegistrationDisposable token for one coordinator or scene-stack registration. Disposal is idempotent and prevents that registration from participating in later lifecycle work.
Members
ts
constructor(disposeWork: Function)Wraps the cleanup callback that will run at most once.
disposeWork: Synchronous callback that detaches the registered item.
ts
get active(): booleanIs true until the first call to dispose.
ts
dispose(): voidDetaches the registration once; later calls have no effect.
AppScene
ts
import { AppScene } from "gamekit";
class AppScene extends FocusGroupBase scene with asynchronous lifecycle hooks, focus state, and operation input gating. A scene belongs to at most one SceneStack; its input remains disabled until it is the ready top scene. Its screen-sized UI goes in screen, a container on engine.screen2d shown, hidden and paused with the scene.
Members
ts
name: stringHuman-readable scene name used in ownership diagnostics.
ts
constructor(name: string)Creates a detached scene. @param name Non-empty diagnostic name. @throws Error when name is empty.
ts
get isInputEnabled(): booleanReports whether the ready top scene may receive input.
ts
get node(): any | nullThe scene's node, or null when the scene has none or its node was disposed on exit. The stack pauses it while the scene is covered.
ts
get screen(): NodeThe scene's screen-space container for screen-sized UI (dialogue, menus, HUDs), drawn without the camera in screen units. It is mounted under ScreenLayers.scenes on engine.screen2d once the scene has a node or a stack takes it; the stack hides and pauses it while the scene is covered, passes it with the scene's node to transitions, and replaces it with a fresh empty container when the scene is released.
ts
attachNode(node: any): voidGives this scene the node that carries its tickers, tweens and World step. The owning SceneStack sets paused on it while the scene is covered and disposes it when the scene is released.
node: A node with a writablepausedflag and adispose()method.- Throws: Error when the node is null or the scene already has one.
ts
async enter(operation?: SceneOperation): Promise<void>Called while input is disabled before this scene becomes active. @param operation Current operation.
ts
async exit(operation?: SceneOperation): Promise<void>Called with input disabled before this scene is released. @param operation Current operation.
ts
async suspend(operation?: SceneOperation): Promise<void>Called with input disabled when another scene covers this scene. @param operation Current operation.
ts
async resume(operation?: SceneOperation): Promise<void>Called with input disabled before this scene becomes ready again. @param operation Current operation.
AppState
ts
import { AppState } from "gamekit";
enum AppStateCoarse coordinator phases reported to application observers. FAILURE retains the triggering error on SceneCoordinator.failure; SHUTDOWN begins before scenes exit.
| Member | Meaning |
|---|---|
BOOT = "boot" | The coordinator has not begun scene entry. |
LOAD = "load" | A scene is loading or entering. |
ACTIVE = "active" | The top scene is ready to receive work. |
SUSPENDED = "suspended" | The active scene is temporarily paused. |
SHUTDOWN = "shutdown" | Shutdown has begun and scenes are exiting. |
FAILURE = "failure" | A lifecycle operation failed. |
FocusGroup
ts
import { FocusGroup } from "gamekit";
class FocusGroup implements IFocusGroupSupplies the default focus bookkeeping for scenes and non-UI focus groups. Extend it and override handleInput when a group accepts application input.
Members
ts
activateFocus(): voidGives this group application focus.
ts
blur(): voidRemoves application focus from this group.
ts
get isFocused(): booleanReports whether this group owns application focus.
ts
handleInput(input: any): booleanDeclines input by default so subclasses opt in explicitly.
input: Caller-defined input value.- Returns: False unless a subclass handles the value.
FocusGroupResolver
ts
import { FocusGroupResolver } from "gamekit";
class FocusGroupResolverResolves one focused application group from screen windows, scene windows, and the top scene. Resolution is screen modal, scene modal, last clicked group, then top scene, with no nested groups.
Members
ts
constructor(scene: IFocusGroup)Creates a resolver with the current top scene as its fallback group.
scene: Top scene receiving focus when no window group wins.
ts
setScene(scene: IFocusGroup): voidChanges the top-scene fallback and immediately resolves focus.
scene: New top scene.
ts
setSceneWindowGroup(group: IFocusGroup | null): voidAssociates the top scene's window layer with this resolver. @param group Scene-owned window group, or null.
ts
setScreenWindowGroup(group: IFocusGroup | null): voidAssociates the persistent screen window layer with this resolver. @param group Screen-owned window group, or null.
ts
setSceneModal(group: IFocusGroup, active: boolean): voidRecords whether a scene-owned modal currently forces focus. @param group Scene window group. @param active Whether its top window is modal.
ts
setScreenModal(group: IFocusGroup, active: boolean): voidRecords whether a screen-owned modal currently forces focus. @param group Screen window group. @param active Whether its top window is modal.
ts
clicked(group: IFocusGroup): voidRecords the group most recently clicked and resolves focus.
group: Scene or window group selected by pointer input.
ts
resolve(): IFocusGroupApplies the documented priority and returns the sole focused group.
- Returns: Screen modal, scene modal, last clicked group, or top scene.
IFocusGroup
ts
import { IFocusGroup } from "gamekit";
interface IFocusGroupDefines an application-level focus boundary shared by scenes and window layers. WillowUI keeps widget focus inside a focused window; GameKit resolves only the owning group.
Members
ts
activateFocus(): voidGives keyboard input ownership to this group.
ts
blur(): voidReleases keyboard input ownership from this group.
ts
readonly isFocused: booleanReports whether this group currently owns application focus.
ts
handleInput(input: any): booleanOffers caller-defined input to the focused group.
input: Input value chosen by the game or adapter.- Returns: True when the group handled the value.
InputContext
ts
import { InputContext } from "gamekit";
class InputContextNamed routing layer that declares exactly which logical actions it can receive. When contexts overlap, InputRouter sends a newly held action to the most recently pushed declaring context.
Members
ts
name: stringNon-empty diagnostic name for the routing layer.
ts
kind: InputContextKindSemantic layer label; it does not determine routing precedence.
ts
constructor(name: string, kind: InputContextKind, actions: string[])Copies the declared action set for one routing layer.
name: Non-empty diagnostic name.kind: Simulation, screen, modal, text-entry, or debug label.actions: Logical action names this context accepts.- Throws: Error if
nameis empty.
ts
declares(action: string): booleanTests membership in the copied action declaration list.
action: Logical action name to query.
ts
actions(): string[]Returns a detached copy of declared action names in original order.
InputContextKind
ts
import { InputContextKind } from "gamekit";
enum InputContextKindDescribes the game layer receiving routed actions; routing precedence still follows context stack order, not this label.
| Member | Meaning |
|---|---|
SIMULATION = "simulation" | Input consumed by world or fixed-step simulation. |
SCREEN = "screen" | Input for a full screen or scene. |
MODAL = "modal" | Input for a blocking overlay. |
TEXT_ENTRY = "text-entry" | Input for editable text. |
DEBUG = "debug" | Input reserved for diagnostic controls. |
InputPolicy
ts
import { InputPolicy } from "gamekit";
class InputPolicyBuilds edge-aware logical action frames by asking the core InputMap about the actions in play. Bindings, rebinding and persistence live in InputMap; the policy only names the actions to watch, so a game binds InputMap.bind(Action.JUMP, [Key.SPACE]) and watches "jump" here. Axis actions follow the InputMap rule: their pressed and released edges come from their two direction actions.
Members
ts
watch(action: string, id: int, keys: int[] = []): InputPolicyAdds one action to every frame this policy builds.
action: Logical action name used by contexts, recordings and game code.id: TheInputMapaction id bound for it (an enum member converted withas int).keys: Keys bound to the action that WillowUI may claim for a widget. They matter only oncepassThroughis set; leave empty for pad-only actions.- Returns: This policy, for chaining.
- Throws: Error if the name is empty or already watched.
ts
passThrough(inputManager: InputManager | null): InputPolicyMakes the policy see only the keys WillowUI left available: a watched key the UI consumed this frame (a modal taking Escape, a focused widget taking Enter) does not press or hold its action, so one key never acts in the UI and the game at once. Read the frame after WillowUI's per-frame update.
inputManager: The WillowUIInputManager(itsisKeyAvailableandisKeyJustAvailableare asked); GameKit requires willowui-tks. Null restores raw reads.- Returns: This policy, for chaining.
ts
frame(): ActionFrameReads InputMap for the current presentation frame, once per watched action.
- Returns: Logical states in watch order: held, edges, and the
InputMapvalue (-1..1 for axes, 0 or 1 for buttons).
ts
focusLost(): ActionFrameEmits one release for every previously held action, then clears edge history.
- Returns: Release-only frame suitable for routing before focus changes.
ts
close(): voidRejects a pending InputMap.captureNext() so an options screen never leaves a capture running after it closes.
InputRecorder
ts
import { InputRecorder } from "gamekit";
class InputRecorderAccumulates detached action frames for deterministic replay.
Members
ts
record(frame: ActionFrame): voidAppends a deep frame copy so later mutation cannot alter the recording.
frame: Resolved logical frame to retain.
ts
recording(): InputRecordingSnapshots all frames recorded so far into an independent recording.
ts
clear(): voidRemoves retained frames without affecting recordings already produced.
InputRecording
ts
import { InputRecording } from "gamekit";
class InputRecordingImmutable-by-interface sequence of copied logical action frames.
Members
ts
constructor(frames: ActionFrame[])Deep-copies the supplied frame sequence.
frames: Frames retained in replay order.
ts
frames(): ActionFrame[]Returns deep copies in replay order.
ts
get frameCount(): intNumber of frames available to a new replay cursor.
InputReplay
ts
import { InputReplay } from "gamekit";
class InputReplayForward-only cursor over an isolated copy of an input recording.
Members
ts
constructor(recording: InputRecording)Copies all recorded frames and positions the cursor before the first one.
recording: Source recording, which remains reusable by other cursors.
ts
get frameCount(): intTotal frames in the replay, independent of cursor position.
ts
get finished(): booleanIs true after the cursor has consumed every frame.
ts
next(): ActionFrameAdvances once and returns a detached copy of the frame at the old cursor.
- Throws: Error when no frames remain.
InputRouter
ts
import { InputRouter } from "gamekit";
class InputRouterRoutes logical actions through an explicit context stack while preserving press-to-release ownership. A held action stays captured by its original context even if higher contexts appear; removing that context queues one release.
Members
ts
push(context: InputContext): voidPlaces a context at highest routing precedence.
context: Context to add by identity.- Throws: Error if the same context instance is already routed.
ts
remove(context: InputContext): voidRemoves a context and queues releases for actions it currently captures.
context: Context identity to remove; an absent context is ignored.
ts
route(frame: ActionFrame): RoutedInputDelivers queued releases first, then routes held/released actions while maintaining captures.
frame: Logical action frame to distribute.- Returns: Per-context frames for all currently routed contexts plus any removed context owed a release.
InputSample
ts
import { InputSample } from "gamekit";
class InputSampleNormalized state of one physical control during a presentation frame. Platform bridges provide samples; action policy treats disconnected controls as inactive.
Members
ts
device: stringNon-empty device namespace used for exact control matching.
ts
control: stringNon-empty control name within the device namespace.
ts
value: floatSigned analog magnitude; digital controls conventionally use zero or one.
ts
connected: booleanWhether the physical source remains connected and eligible to activate actions.
ts
repeating: booleanWhether the source emitted an explicit repeat edge this frame.
ts
constructor(device: string, control: string, value: float, connected: boolean = true, repeating: boolean = false)Captures one bridge-provided control reading.
device: Device namespace.control: Control code.value: Signed magnitude interpreted against binding thresholds.connected: Setfalsefor a hot-unplug sample.repeating: Settrueonly for an explicit platform repeat.- Throws: Error if device or control is empty.
RoutedInput
ts
import { RoutedInput } from "gamekit";
class RoutedInputPer-context action-frame result produced by one InputRouter.route call. Reads return copies, and an unknown context receives an empty frame without changing other contexts.
Members
ts
forContext(context: InputContext): ActionFrameReturns a detached frame for one context, creating an empty bucket if needed.
context: Context identity whose delivered actions are requested.
ts
add(context: InputContext, state: ActionState): voidCopies an action state into a context bucket, replacing the same action if already present.
context: Destination context identity.state: Logical state to copy.
SceneCoordinator
ts
import { SceneCoordinator } from "gamekit";
class SceneCoordinatorCoordinates the application's sole scene stack with scene-scoped clocks, input contexts, assets, saves, and coarse state. Input and clocks turn off before a scene hook and return only after the new top scene is ready; assets retire on exit. Scene nodes have their own ticker (game-loop spec section 3); effects scheduled on a node's ticker respect the node's pause and timeScale state, so registerClock with the scene's node ticker integrates time scaling and pause directly.game-loop.md section 6.
Members
ts
scenes: SceneStackSole scene-lifetime owner used by the coordinator and passive adapters.
ts
constructor(observer: Function | null = null)Creates a coordinator in BOOT with an empty scene stack.
observer: Optional synchronous callback receiving every assignedAppStatein order.
ts
get state(): AppStateReports the latest coarse lifecycle state published to the observer.
ts
get failure(): Error | nullReturns the most recent caught lifecycle/save error, or null before any failure.
ts
registerClock(scene: any, clock: any): AppRegistrationAssociates a pausable clock with a scene, resuming it on activation and pausing it on suspension or exit.
scene: Scene whose active lifetime controls the clock.clock: A coreTicker(paused through itspausedflag), a scene node'sticker(which respects the node's pause and timeScale), or any object exposing synchronouspauseandresumemethods.- Returns: Disposable association; disposal does not pause the clock.
- Throws: Error if
clockis null.
ts
registerInputContext(scene: any, router: any, context: any): AppRegistrationPushes a context only while its scene is the ready top and removes it before every scene change.
scene: Scene that owns the context lifetime.router: Object exposingpush(context)andremove(context).context: Neutral input context active only while its owner is the ready top scene.- Returns: Disposable association that removes an already-active context.
- Throws: Error if the router or context is null.
ts
registerAssetScope(scene: any, scope: any): AppRegistrationAssociates a disposable asset scope with a scene so it is released after the scene exits.
scene: Scene that owns the scope lifetime.scope: Object exposing synchronousdispose.- Returns: Disposable association; early disposal detaches but does not dispose the scope.
- Throws: Error if
scopeis null.
ts
registerSave(work: Function): AppRegistrationAppends asynchronous save work to the coordinator's ordered save pipeline.
work: Zero-argument callback awaited during each save request.- Returns: Disposable registration that excludes the callback from later save snapshots.
- Throws: Error if
workis null.
ts
async boot(scene: any): Promise<boolean>Runs the one-time BOOT -> LOAD -> ACTIVE sequence and starts the first scene.
scene: Initial detached scene.- Returns:
truewhen active;falseafter cancellation or a caught failure. - Throws: Error if boot has already been attempted.
ts
async replace(scene: any, options: { transition?: Transition } | null = null): Promise<boolean>Publishes LOAD, replaces the top scene, then publishes ACTIVE on success.
scene: Detached replacement scene.options: Optional{ transition }forwarded toSceneStack.replace.- Returns:
trueon activation;falseafter cancellation or a caught failure.
ts
async push(scene: any, options: { transition?: Transition } | null = null): Promise<boolean>Suspends the current scene and activates a new top scene without publishing LOAD.
scene: Detached scene to push.options: Optional{ transition }forwarded toSceneStack.push.- Returns:
trueon activation;falseafter cancellation or a caught failure.
ts
async pop(options: { transition?: Transition } | null = null): Promise<boolean>Exits the top scene and resumes the scene beneath it.
options: Optional{ transition }forwarded toSceneStack.pop.- Returns:
trueafter the boundary completes;falseafter cancellation or a caught failure.
ts
async suspend(): Promise<boolean>Suspends the current top and publishes SUSPENDED without releasing scene ownership.
- Returns:
trueafter suspension;falseafter cancellation or a caught failure.
ts
async resume(): Promise<boolean>Resumes the current top and publishes ACTIVE.
- Returns:
trueafter resumption;falseafter cancellation or a caught failure.
ts
async save(): Promise<boolean>Awaits a snapshot of registered save callbacks in registration order, coalescing concurrent callers onto one run.
- Returns:
truewhen every callback completes;falseafter storing the first failure.
ts
async quit(): Promise<boolean>Coalesces quit requests, drains an in-flight save, publishes SHUTDOWN, and exits all scenes top-down.
- Returns:
trueafter shutdown, orfalsewhen scene teardown fails and state becomesFAILURE.
SceneOperation
ts
import { SceneOperation } from "gamekit";
class SceneOperationIdentifies one scene-stack mutation and lets newer work invalidate stale asynchronous completion. IDs increase within one stack. Scene hooks may call check after awaits.
Members
ts
kind: stringStack operation such as push, replace, or shutdown.
ts
id: intMonotonic identifier assigned by the owning SceneStack.
ts
constructor(kind: string, id: int)Creates an active operation marker. @param kind Operation name. @param id Stack-local sequence number.
ts
get cancelled(): booleanReports whether newer work cancelled this operation.
ts
get cancelReason(): stringExplains cancellation, or is empty while active.
ts
cancel(reason: string = "superseded"): voidCancels this operation. @param reason Diagnostic reason used by check.
ts
check(): voidVerifies that asynchronous scene work remains current. @throws Error when cancelled.
SceneStack
ts
import { SceneStack } from "gamekit";
class SceneStackOwns a game's asynchronous scene stack and keeps focus and input on only its ready top scene. Push covers the prior scene, pop is back navigation, and replace keeps the same stack position.
Members
ts
constructor(observer: any = null)Creates an empty stack. @param observer Optional passive scene lifecycle observer.
ts
get count(): intCounts owned scenes, including covered scenes.
ts
get top(): any | nullReturns the focused top scene, or null when empty.
ts
scenes(): any[]Returns a detached bottom-to-top scene snapshot.
ts
get transitioning(): booleanReports whether a scene lifecycle hook is still completing.
ts
addObserver(observer: any): AppRegistrationAdds a passive lifecycle observer without sharing stack ownership.
observer: Object implementing the_sceneChanging,_sceneActivated,_sceneSuspended,_sceneResumed, and_sceneExitedhooks it needs.- Returns: Disposable observer registration.
- Throws: Error for null or duplicate observers.
ts
async start(scene: any): Promise<boolean>Enters the first scene with input gated until it is ready.
scene: Detached scene to own.- Returns: True after activation, or false when superseded.
- Throws: Error when non-empty or the scene is already owned.
ts
async replace(scene: any, options: { transition?: Transition } | null = null): Promise<boolean>Exits the top scene and enters a replacement without resuming a covered scene.
scene: Detached replacement scene.options: Optional{ transition }: a Willow transition played between the two scene nodes; input stays gated and the leaving node alive until it ends.- Returns: True after activation, or false when superseded.
ts
async push(scene: any, options: { transition?: Transition } | null = null): Promise<boolean>Suspends the current top and pushes a new scene above it.
scene: Detached scene to push.options: Optional{ transition }played between the two scene nodes, as forreplace.- Returns: True after activation, or false when superseded.
ts
async pop(options: { transition?: Transition } | null = null): Promise<boolean>Pops the top scene and resumes the scene beneath it as back navigation.
options: Optional{ transition }played from the popped scene node to the one beneath, as forreplace.- Returns: True after the boundary, or false when superseded.
- Throws: Error when the stack is empty.
ts
async suspend(): Promise<boolean>Suspends the top scene in place. @returns True after suspension, or false when superseded.
ts
async resume(): Promise<boolean>Resumes the top scene in place, enabling input only after its hook completes. @returns True after readiness.
ts
async shutdown(): Promise<void>Exits and releases every scene from top to bottom with input disabled.
ScreenLayers
ts
import { ScreenLayers } from "gamekit";
class ScreenLayersThe two GameKit containers on Willow's screen-space root (engine.screen2d, meta-thicket scenes.md problem 10). scenes holds one AppScene.screen per scene, in the order the scenes were mounted; overlay is drawn above all of them and is never part of a scene transition, so a toast or debug HUD added there stays on top. Scene screens draw on WillowUI's RENDER_LAYER_UI and the overlay on RENDER_LAYER_OVERLAY, so a plain quad (a fade, a gauge) sorts with the WillowUI windows beside it in tree order.
Members
ts
static get scenes(): NodeThe container under screen2d that holds each scene's screen container. Created on first read.
ts
static get overlay(): NodeThe app-global screen container drawn above every scene's UI; add screen-sized nodes that outlive scenes here.
ts
static mount(): booleanAdds both containers to Scene.main.screenRoot when a Willow scene is running and they are not there yet.
- Returns: True when both containers are on the running scene's screen root, false without a Willow scene.
TickInput
ts
import { TickInput } from "gamekit";
class TickInputTurns one InputPolicy frame per simulation tick into a frame a fixed-step game can consume without losing taps. Devices latch their edges once per presentation frame, so a game that ticks slower than it draws (or reads mid-tick) can miss a short press. This helper reads true pressed on the first tick an action is held even when the device edge fell in a frame that ran no tick, and never twice for one hold; and a direction pair declared with axis that was pressed and already released still counts as one tick of that axis, so a sub-tick tap moves one step.
Members
ts
axis(axis: string, negative: string, positive: string): TickInputDeclares a two-button axis whose sub-tick taps still count as one tick of -1 or 1.
axis: Name of the axis action in the frame (its value is replaced only when the frame reports 0).negative: Name of the action pushing the axis to -1.positive: Name of the action pushing the axis to 1.- Returns: This helper, for chaining.
ts
next(frame: ActionFrame): ActionFrameNormalises this tick's frame; call exactly once per tick.
frame: TheInputPolicyframe read this tick.- Returns: The frame the simulation consumes: same actions, press-once-per-hold, tap-reliable axes.