mwg API
    Preparing search index...

    Class Text2D

    Text under an MWG-owned name, for the case ui.Label/ui.BitmapLabel do not cover - a one-off caption inside a Shape2D-drawn diagram, say, rather than themed game-wide UI text. Prefer Label/BitmapLabel for anything styled through ui.theme().

    import { Text2D } from '@datamoc/mw_games/two-d/render';

    const caption = new Text2D({ text: 'N', style: { fill: 0xffffff, fontSize: 14 } });
    caption.x = 40;
    caption.y = 4;

    Hierarchy

    • Text
      • Text2D
    Index
    • Parameters

      • Optionaloptions: CanvasTextOptions

        The options of the text.

      Returns Text2D

    • Parameters

      • Optionaltext: TextString
      • Optionaloptions: Partial<TextStyle>

      Returns Text2D

      since 8.0.0