mwg API
    Preparing search index...

    Interface RevealState

    Progressive text display - the typewriter reveal every dialogue box wants, shared rather than reimplemented per widget. MessageBox pages, Label lines and RichLabel markdown all run on this one character count; what differs is only what each widget counts (Label counts string characters, RichLabel visible ones via sliceSpans, markers excluded) and who calls advanceReveal each frame.

    Pure logic, no Pixi dependency: a game driving its own reveal (a title screen, a tutorial toast) can use this without any widget at all.

    import { startReveal, advanceReveal, completeReveal, revealComplete } from '@datamoc/mw_games/two-d/ui';

    const reveal = startReveal('Hello.'.length, 40);
    advanceReveal(reveal, 0.5); // 20 characters per half second at speed 40
    revealComplete(reveal); // false
    completeReveal(reveal); // skip ahead, for a confirm press mid-reveal
    revealComplete(reveal); // true
    interface RevealState {
        revealed: number;
        speed: number;
        total: number;
    }
    Index
    revealed: number

    characters revealed so far, possibly fractional between frames

    speed: number

    characters per second; 0 starts fully revealed

    total: number

    characters to reveal in total, counted the caller's way