mwg API
    Preparing search index...

    Class MarqueeLabel

    One line of text that stays on one line: when it is wider than width it slides back and forth inside a clipped window (marqueeOffset), driven by update(dt). Under reduced motion it holds still, cut short with an ellipsis, instead of moving.

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

    const title = new MarqueeLabel({ width: 160, text: 'A very long track title that cannot fit' });
    title.update(1 / 60); // once a frame from the scene

    Hierarchy

    • Container
      • MarqueeLabel
    Index
    • get shift(): number

      where the text is shifted to now (0 until it has waited out its first pause)

      Returns number

    • the text's width in pixels; its own method so a test can supply it

      Parameters

      • text: string

      Returns number