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

    Function asTextDPR

    • Creates a Canvas 2D Text instance with DPR (Device Pixel Ratio) scaling for crisp rendering.

      This renders text at a higher resolution (dprScale × fontSize) then scales it down, resulting in sharper text similar to how Retina displays work.

      Use this for static text that doesn't change frequently. For dynamic text that updates every frame, use asBitmapText instead for better performance.

      Parameters

      Returns Text

      // Render at 2× resolution (default)
      const label = asTextDPR(
      { text: 'Hello', style: { fontFamily: 'PixelOperator8', fontSize: 16 } },
      { x: 100, y: 50 }
      );

      // Render at 4× resolution for even crisper text
      const crispLabel = asTextDPR(
      { text: 'Hello', style: { fontFamily: 'PixelOperator8', fontSize: 16 }, dprScale: 4 },
      { x: 100, y: 50 }
      );