mwg API
    Preparing search index...

    Class ScrollBox

    A clipped viewport with a scrollbar: put rows in content and they scroll inside the box, everything outside it hidden by a mask. The scrollbar is drawn from the theme; the wheel, scrollBy and scrollIntoView all run through scrollOffset, so they clamp the same way.

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

    const box = new ScrollBox({ width: 200, height: 120, contentHeight: 400 });
    box.scrollBy(60);
    console.log(box.offset); // 60

    Hierarchy

    • Container
      • ScrollBox
    Index
    content: Container<ContainerChild> = ...

    add the rows to scroll here

    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 });
    • scrolls just enough to bring a height-tall item at top fully into view

      Parameters

      • top: number
      • height: number

      Returns void