
These are the core environment/control surfaces most games hit first.
Current surface:
setTitle(title)setSize(width, height)setFullscreen(enabled)getSize()getPixelRatio()getFPS()setCursorVisible(visible)setCursorLocked(locked)setCursor(cursor)screenshot(path?)minimize()restore()focus()close()Compatibility/read-only fields commonly present:
aura.window.widthaura.window.heightaura.window.pixelRatioaura.window.fpsUse cases:
FPS lifecycle notes:
setCursorVisible(...) and setCursorLocked(...) are separate controls; call both explicitly for FPS camera rigs.getMouseDelta() result so the first locked/unlocked frame does not replay stale motion.aura.onBlur and aura.onFocus do not implicitly change cursor lock or visibility preference; if your game should unlock on blur, do it in aura.onBlur().Core keyboard/mouse/gamepad methods:
isKeyDown(key)isKeyPressed(key)isKeyReleased(key)getMousePosition()getMouseDelta()isMouseDown(button)isMousePressed(button)getMouseWheel()isGamepadConnected(index?)getGamepadAxis(axis, index?)isGamepadButtonDown(button, index?)Compatibility aliases:
isDown(...)isPressed(...)isReleased(...)Bridged helper views exposed for convenience:
aura.input.mouse.xaura.input.mouse.yaura.input.mouse.scrollaura.input.mouse.getDelta()aura.input.mouse.isDown(button)aura.input.mouse.isPressed(button)aura.input.mouse.isReleased(button)aura.input.gamepad.connectedaura.input.gamepad.axis(name)aura.input.gamepad.isDown(button)aura.input.gamepad.isPressed(button)aura.input.gamepad.isReleased(button)aura.input.actionMapUse cases:
Mouse-delta note:
getMouseDelta() is the canonical relative-look primitive. Lock/unlock and blur/focus transitions clear the current-frame delta before game code observes it.For first-person games, treat cursor lock plus relative delta as one explicit control path:
let lookLocked = false;
let yawDeg = 0;
let pitchDeg = 0;
function setLookLocked(locked) {
aura.window.setCursorLocked(locked);
aura.window.setCursorVisible(!locked);
lookLocked = locked;
}
aura.onBlur = function onBlur() {
if (lookLocked) setLookLocked(false);
};
aura.onQuit = function onQuit() {
if (lookLocked) {
setLookLocked(false);
return false;
}
return true;
};
aura.update = function update() {
if (!lookLocked && aura.input.isMousePressed('left')) {
setLookLocked(true);
return; // consume the click that entered lock
}
if (!lookLocked) return;
const delta = aura.input.getMouseDelta();
yawDeg -= delta.x * 0.14;
pitchDeg = Math.max(-89, Math.min(89, pitchDeg - (delta.y * 0.14)));
};
Recommended rules:
setCursorLocked(...) and setCursorVisible(...) together. Do not rely on one to imply the other.aura.onBlur() if your game should return the cursor to the OS when focus leaves the window.false so the first Esc cancels lock instead of closing the game.getMouseDelta() while locked.The 2D camera is a stateful helper over immediate-mode 2D drawing.
State fields commonly used directly:
aura.camera.xaura.camera.yaura.camera.zoomaura.camera.rotationMethods:
getState()follow(target, options?)stopFollow()setDeadzone(x, y, width, height)clearDeadzone()setBounds(x, y, width, height)clearBounds()pan(...)panTo(...)zoomTo(...)rotateTo(...)shake(...)clearEffects()onEffectComplete(callback, order?)offEffectComplete(callbackId)update(dt)Use cases:
isKeyDown over compatibility aliases in generated code.aura.camera for game camera state instead of carrying your own global transform unless you need custom math.aura.camera3d instead of this namespace.