docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SVGParser

    Reads an SVG document and builds a vector scene.

    Inheritance
    object
    SVGParser
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.VectorGraphics
    Assembly: Unity.VectorGraphics.dll
    Syntax
    public class SVGParser

    Methods

    ImportSVG(TextReader, float, float, int, int, bool)

    Kicks off an SVG file import.

    Declaration
    public static SVGParser.SceneInfo ImportSVG(TextReader textReader, float dpi = 0, float pixelsPerUnit = 1, int windowWidth = 0, int windowHeight = 0, bool clipViewport = false)
    Parameters
    Type Name Description
    TextReader textReader

    The reader object containing the SVG file data

    float dpi

    The DPI of the SVG file, or 0 to use the device's DPI

    float pixelsPerUnit

    How many SVG units fit in a Unity unit

    int windowWidth

    The default with of the viewport, may be 0

    int windowHeight

    The default height of the viewport, may be 0

    bool clipViewport

    Whether the vector scene should be clipped by the SVG document's viewport

    Returns
    Type Description
    SVGParser.SceneInfo

    A SceneInfo object containing the scene data

    ImportSVG(TextReader, ViewportOptions, float, float, int, int)

    Kicks off an SVG file import.

    Declaration
    public static SVGParser.SceneInfo ImportSVG(TextReader textReader, ViewportOptions viewportOptions, float dpi = 0, float pixelsPerUnit = 1, int windowWidth = 0, int windowHeight = 0)
    Parameters
    Type Name Description
    TextReader textReader

    The reader object containing the SVG file data

    ViewportOptions viewportOptions

    The viewport options to use

    float dpi

    The DPI of the SVG file, or 0 to use the device's DPI

    float pixelsPerUnit

    How many SVG units fit in a Unity unit

    int windowWidth

    The default with of the viewport, may be 0

    int windowHeight

    The default height of the viewport, may be 0

    Returns
    Type Description
    SVGParser.SceneInfo

    A SceneInfo object containing the scene data

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)