pixi.js
    Preparing search index...

    Function graphicsContextToSvg

    • Converts a Graphics object or GraphicsContext into an SVG string.

      This is a pure function — it reads from the context's instructions and returns a self-contained SVG document string. Texture instructions are skipped since they have no SVG equivalent.

      Parameters

      • source: Graphics | GraphicsContext

        A Graphics instance or a GraphicsContext.

      • precision: number = 2

        Decimal places for SVG coordinates (default 2).

      Returns string

      A complete SVG document string.