mwg API
    Preparing search index...

    Class Checkbox

    A square box that is ticked or not, the toggle a settings row or an option list puts beside its label. It draws only the box and its tick - a caption is a Label the game places next to it, so the two can be laid out and translated independently.

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

    const fullscreen = new Checkbox({ checked: true });
    fullscreen.onChange.add((on) => console.log('fullscreen', on));
    fullscreen.toggle();

    Hierarchy

    • Container
      • Checkbox
    Index
    onChange: Signal<boolean> = ...
    • 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 });
    • sets the box, firing onChange only when the value actually moves

      Parameters

      • checked: boolean

      Returns void