mwg API
    Preparing search index...

    Class StatsScreen

    A read-only "your stats" display: one label: value line per StatRow, over the same Label every other screen already builds from - a recipe, not a new primitive, the way HelpScreen composes ListView/Label rather than inventing its own row widget. No navigation or selection here: a stats readout has nothing to pick, unlike HelpScreen's topic list, so this is just a Label wrapping a game's own aggregate (core.PlayerStats, typically) formatted into rows.

    import { StatsScreen } from '@datamoc/mw_games/two-d/ui';

    const screen = new StatsScreen({
    width: 200,
    stats: [
    { label: 'Runs completed', value: '12' },
    { label: 'Best depth', value: '7' },
    ],
    });

    screen.setStats([{ label: 'Runs completed', value: '13' }]); // a new run just ended

    Hierarchy

    • Container
      • StatsScreen
    Index
    • replaces every row, for a screen kept alive while its stats keep changing

      Parameters

      • stats: readonly StatRow[]
      • Optionalwidth: number

      Returns void