mwg API
    Preparing search index...

    Class RadioGroup

    One choice among several, where a checkbox would allow many: exactly one option is selected, arrows move the selection (which selects at once, the way native radio groups do), and a tap selects directly. Disabled options are skipped by the keyboard and ignore the pointer, the same contract ListView rows keep.

    import { RadioGroup } from '@datamoc/mwg/two-d/ui';

    const side = new RadioGroup({ options: [{ text: 'White' }, { text: 'Black' }] });
    side.onChange.add((index) => console.log('side', index));
    side.select(1);

    Hierarchy

    • Container
      • RadioGroup
    Index
    onChange: Signal<number> = ...
    • Removes all internal references and listeners as well as removes children from the display list. Do not use a Container after calling destroy.

      Parameters

      • Optionaloptions: DestroyOptions

        Options parameter. A boolean will act as if all options have been set to that value

      Returns void

      container.destroy();
      container.destroy(true);
      container.destroy({ children: true });
      container.destroy({ children: true, texture: true, textureSource: true });
    • Parameters

      • action: string

      Returns boolean

      true when the action was used

    • Steps the selection by delta rows, skipping disabled options and wrapping at both ends, the way a short settings group wants. Returns false when there is nothing selectable to move to, so a caller can beep rather than doing nothing.

      Parameters

      • delta: number

      Returns boolean

    • picks an option, firing onChange only when the choice actually moves

      Parameters

      • index: number

      Returns void

    • selects row index the way a tap does; a disabled row is a no-op

      Parameters

      • index: number

      Returns void