
This page covers loading content, audio playback, simple save persistence, and the runtime file API.
Core loading surface:
load(path)exists(path)loadJson(path)loadText(path)loadFont(path)loadBitmapFont(path)getFormatSupport(path)Streaming/cache helpers:
getState(path)getStateHistory(path)evict(path)getCachePolicy()setCachePolicy(policy)preload2d(paths)preload3d(paths)Use cases:
Notes:
load* family above.load, loadJson, loadText, and the preload/cache methods listed here.Core playback and global control:
play(...)stop(handle)pause(handle)resume(handle)getState(handle)setVolume(handle, volume)setMasterVolume(volume)pauseAll()resumeAll()stopAll()Spatial audio and listener/emitter helpers:
setHRTF(enabled)setListener(options)playSpatial(pathOrSpec, options)setEmitterPosition(handle, position)setOcclusion(handle, value)addReverbZone(zone)removeReverbZone(zoneId)clearReverbZones()Mixer/bus/envelope helpers:
setBusVolume(bus, volume)assignBus(handle, bus)fadeTrack(handle, options)fadeBus(bus, options)crossfade(fromHandle, toHandle, options)update(dt)clearEnvelopes()getMixerState()Use cases:
Truth boundary:
getState(handle) returns null for unknown or inactive handlesresumeAll() only resumes handles paused by pauseAll(), not handles
gameplay paused explicitly earliernull because that runtime path does not own sample
positionGenerated 2D projects can also use src/starter-utils/scene-audio-2d.js when
you want one explicit scene-level ownership lane on top of aura.audio.
The helper owns a deliberately small contract:
createSceneAudio2D(aura, options?)ensureSceneMusic2D(sceneAudio, path, options?)playSceneStinger2D(sceneAudio, path, options?)pauseSceneAudio2D(sceneAudio, options?)resumeSceneAudio2D(sceneAudio, options?)syncSceneAudio2D(sceneAudio, dt, options?)stopSceneAudio2D(sceneAudio, options?)Truth boundary:
aura.audio mixer/bus surfaceassets/title-loop.wavaura.assets.exists(path) firstPersistence surface:
save(key, value)load(key, fallback?)delete(key)keys()Legacy aliases:
set(key, value)get(key, fallback?)Use cases:
For larger authored 2D worlds, the scaffolded helper lane now includes
world-persistence-2d.js for explicit streamed-world snapshot and rehydrate
ownership over aura.storage.
Keep that boundary honest:
For authored 2D adventure starters, the shared helper lane also includes
adventure-save-2d.js for explicit route-progression save composition and
checkpoint restore ownership over aura.storage.
Accepted helper surface:
captureAdventureSaveState2D(...)captureAdventureCheckpoint2D(...)captureAdventureCampaignSaveSummary2D(...)composeAdventureCheckpointState2D(...)applyAdventureSaveState2D(...)saveAdventureSaveState2D(...)saveAdventureCampaignSaveSlot2D(...)loadAdventureSaveState2D(...)loadAdventureCampaignSaveSlot2D(...)deleteAdventureSaveState2D(...)Truth boundary:
For a menu-facing campaign slot layer above those snapshots, the shared helper
lane now also includes campaign-save-2d.js.
Accepted helper surface:
createCampaignSaveSummary2D(...)createCampaignSaveRecord2D(...)resolveContinueCampaignSaveSlot2D(...)resolveCampaignSaveBoundary2D(...)listCampaignSaveSlots2D(...)saveCampaignSaveSlot2D(...)loadCampaignSaveSlot2D(...)deleteCampaignSaveSlot2D(...)Truth boundary:
aura.storageVendored pack JSON/text ownership:
content/packs/** is an accepted game-owned path once a project vendors a
pack payload thereaura.assets.loadJson(...),
aura.assets.loadText(...), or import them as authored JSON modules when the
project structure supports itexamples/sector-surge-2d, which imports vendored HUD
and scene-audio JSON from content/packs/... directlyRuntime-safe file helpers:
exists(path)readText(path)writeText(path, value)readJson(path)writeJson(path, value)mkdir(path)list(path)remove(path)Important notes:
.. traversal are rejectedFor richer save/export/apply flows, see 07 Scenes, State, Debug, and Test Harness and the auramaxx state CLI docs.