@moxijs/core - v0.3.4
    Preparing search index...

    Function asMSDFText

    • Creates an MSDF BitmapText instance for resolution-independent crisp text.

      MSDF (Multi-channel Signed Distance Field) fonts render sharp text at any scale, similar to Unity's TextMesh Pro. Unlike regular BitmapText which pixelates when scaled, MSDF text maintains crisp edges.

      MSDF fonts must be pre-generated using msdf-bmfont-xml and loaded via Assets.load().

      Parameters

      Returns BitmapText

      // First, load the MSDF font (the .json file, not .fnt)
      await Assets.load('assets/fonts/msdf/Roboto.json');

      // Then create text - scales perfectly at any size
      const title = asMSDFText(
      { text: 'Hello World', style: { fontFamily: 'Roboto', fontSize: 48 } },
      { x: 100, y: 50, anchor: 0.5 }
      );

      // MSDF text stays crisp even when scaled up
      title.scale.set(2); // Still sharp!