AURA

JSGG

AuraJS
DOCSEXAMPLESGITHUB
Lifecycle, Window, Input, and 2D Camera Exact Reference
Narrow exact-reference page for the first game loop, window shell, input polling, and the 2D camera surface.
docs/reference/lifecycle-window-input-and-2d-camera-exact-reference.md

Lifecycle, Window, Input, and 2D Camera Exact Reference

Use this page when the task is in the first game loop, the runtime shell, or the first playable 2D camera path.

Table of Contents

  1. Covers
  2. Open These Handbook Pages First
  3. Canonical Contracts
  4. Namespace Coverage Summary
  5. Namespaces

Covers

  • Lifecycle Callbacks
  • aura.window
  • aura.input
  • aura.camera

Open These Handbook Pages First

Canonical Contracts

Namespace Coverage Summary

Namespace Exact Signatures Additional Method Names Native Web
Lifecycle Callbacks 6 0 supported see_web_build_contract_v1
aura.window 8 6 supported supported
aura.input 13 3 supported supported
aura.camera 22 0 supported supported

Namespaces

`Lifecycle Callbacks`

Host-invoked game lifecycle callbacks.

  • Native support: supported
  • Web support: see_web_build_contract_v1
  • Exact signatures in generated schema: 6
  • Additional known method names: 0
  • Contract source: api-contract.md

Exact Signatures

aura.draw = function(): void
aura.onBlur = function(): void
aura.onFocus = function(): void
aura.onResize = function(width: number, height: number): void
aura.setup = function(): void
aura.update = function(dt: number): void

`aura.window`

Query and mutate the application window (title, size, fullscreen, cursor visibility/lock, pixel ratio, FPS).

  • Native support: supported
  • Web support: supported
  • Exact signatures in generated schema: 8
  • Additional known method names: 6
  • Contract source: api-contract.md

Exact Signatures

aura.window.getFPS(): number
aura.window.getPixelRatio(): number
aura.window.getSize(): { width: number, height: number }
aura.window.setCursorLocked(locked: boolean): void
aura.window.setCursorVisible(visible: boolean): void
aura.window.setFullscreen(enabled: boolean): void
aura.window.setSize(width: number, height: number): void
aura.window.setTitle(title: string): void

Additional Known Method Names

aura.window.close(...)
aura.window.focus(...)
aura.window.minimize(...)
aura.window.restore(...)
aura.window.screenshot(...)
aura.window.setCursor(...)

Exact signature extraction is still incomplete for the methods above. Use the canonical contract source if argument or return-value detail matters.

`aura.input`

Poll keyboard, mouse, relative mouse delta, and gamepad state for the current frame.

  • Native support: supported
  • Web support: supported
  • Exact signatures in generated schema: 13
  • Additional known method names: 3
  • Contract source: api-contract.md

Exact Signatures

aura.input.getGamepadAxis(index: number, axis: number): number
aura.input.getMouseDelta(): { x: number, y: number }
aura.input.getMousePosition(): { x: number, y: number }
aura.input.getMouseWheel(): number
aura.input.getTextInput()
aura.input.getTextInput(): string
aura.input.isGamepadButtonDown(index: number, button: number): boolean
aura.input.isGamepadConnected(index: number): boolean
aura.input.isKeyDown(key: string): boolean
aura.input.isKeyPressed(key: string): boolean
aura.input.isKeyReleased(key: string): boolean
aura.input.isMouseDown(button: number): boolean
aura.input.isMousePressed(button: number): boolean

Additional Known Method Names

aura.input.isDown(...)
aura.input.isPressed(...)
aura.input.isReleased(...)

Exact signature extraction is still incomplete for the methods above. Use the canonical contract source if argument or return-value detail matters.

`aura.camera`

Canonical 2D camera state (x, y, zoom, rotation) plus additive deterministic camera-rig helpers (follow, setDeadzone, setBounds, pan/zoom/rotate/shake, update) consumed by draw2d geometry/sprite calls in deterministic call order.

  • Native support: supported
  • Web support: supported
  • Exact signatures in generated schema: 22
  • Additional known method names: 0
  • Contract source: api-contract.md

Exact Signatures

aura.camera.clearBounds(): { ok: true, reasonCode: string }
aura.camera.clearDeadzone(): { ok: true, reasonCode: string }
aura.camera.clearEffects(): { ok: true, cleared: number, reasonCode: string }
aura.camera.fade(options?: { duration?: number, color?: { r: number, g: number, b: number, a?: number } | [number, number, number, number?], fromAlpha?: number, toAlpha?: number, alpha?: number }): { ok: boolean, effectId?: number, reasonCode: string }
aura.camera.flash(options?: { duration?: number, color?: { r: number, g: number, b: number, a?: number } | [number, number, number, number?], alpha?: number }): { ok: boolean, effectId?: number, reasonCode: string }
aura.camera.follow( target: { x: number, y: number } | (() => { x: number, y: number }), options?: { lerpX?: number, lerpY?: number, offsetX?: number, offsetY?: number } ): { ok: boolean, reasonCode: string }
aura.camera.getState(): { x: number, y: number, zoom: number, rotation: number, following: boolean, activeEffects: number, deadzone: { x: number, y: number, width: number, height: number } | null, bounds: { x: number, y: number, width: number, height: number } | null, overlay: { effectType: "fade" | "flash", effectId: number, alpha: number, color: { r: number, g: number, b: number, a: number } } | null }
aura.camera.offEffectComplete(listenerId: number): boolean
aura.camera.onEffectComplete( callback: (event: { type: "effect_complete", effectType: string, effectId: number, reasonCode: string }) => void, order?: number ): { ok: boolean, listenerId?: number, reasonCode: string }
aura.camera.pan(x: number, y: number, options?: { duration?: number }): { ok: boolean, effectId?: number, reasonCode: string }
aura.camera.panTo(x: number, y: number, options?: { duration?: number }): { ok: boolean, effectId?: number, reasonCode: string }
aura.camera.rotateTo(rotation: number, options?: { duration?: number }): { ok: boolean, effectId?: number, reasonCode: string }
aura.camera.rotation: number
aura.camera.setBounds( bounds: { x?: number, y?: number, width: number, height: number } | number, y?: number, width?: number, height?: number ): { ok: boolean, reasonCode: string }
aura.camera.setDeadzone( deadzone: { x?: number, y?: number, width: number, height: number } | number, height?: number ): { ok: boolean, reasonCode: string }
aura.camera.shake(options?: { duration?: number, frequency?: number, intensity?: number, intensityX?: number, intensityY?: number }): { ok: boolean, effectId?: number, reasonCode: string }
aura.camera.stopFollow(): { ok: true, stopped: boolean, reasonCode: string }
aura.camera.update(dt: number): { ok: boolean, reasonCode: string, x?: number, y?: number, zoom?: number, rotation?: number, following?: boolean, activeEffects?: number, overlay?: { effectType: "fade" | "flash", effectId: number, alpha: number, color: { r: number, g: number, b: number, a: number } } | null }
aura.camera.x: number
aura.camera.y: number
aura.camera.zoom: number
aura.camera.zoomTo(zoom: number, options?: { duration?: number }): { ok: boolean, effectId?: number, reasonCode: string }
DOCUMENT REFERENCE
docs/reference/lifecycle-window-input-and-2d-camera-exact-reference.md
AURAJS
Cmd/Ctrl+K
aurajsgg