mwg API
    Preparing search index...

    Class ScrollText

    A wrapped Label in a ScrollBox that sizes itself: the box is as tall as the text up to maxHeight, and scrolls (wheel, touch, keys, scrollbar) beyond it, so a long hint, credit list or result message never spills over what is around it. setText re-measures and resize(width) re-wraps in place; the caller no longer measures the label and feeds setContentHeight by hand.

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

    const hint = new ScrollText({ width: 220, maxHeight: 60 });
    hint.setText('Span the gorge with at most 400 of budget. Cables only pull; beams push as well.');
    console.log(hint.box.viewportHeight <= 60); // true

    Hierarchy

    • Container
      • ScrollText
    Index
    • the text's own height, which sizes the box; its own method so a test can supply it

      Returns number

    • Sets the width in place: the text re-wraps at the new width and the box resizes and re-measures, so a layout change does not rebuild the widget.

      Parameters

      • width: number

      Returns void