Log inGet started
World

Blockbuster 767

Branchmain
Branchesmain
Commit8e9b87fcce

README.md

caption

The written form of everything the Kid says, so a spoken line survives a muted player, a noisy room and a failed generation.

SoundDirector writes; anything that draws reads.

local Caption = require("game.audio.caption")

local now = Caption.current()   -- { id, text, remaining, duration } or nil
local off = Caption.on(function(shown) ... end)   -- every new line, and nil on clear

SoundDirector draws the words itself, in a band above the bottom control band, laid out from the live ui.screenSize(). A screen that would rather carry the line inside its own composed card takes the job:

Caption.claim("bb_screens")   -- SoundDirector's band stands down
Caption.release()             -- hand it back

Time is handed in rather than read: Caption.tick(dt) is called once a frame by SoundDirector, so a caption follows the game's clock and holds still while the game is paused.