Class SVGParser | Vector Graphics | 1.0.0-preview.34
docs.unity3d.com
    Show / Hide Table of Contents

    Class SVGParser

    Reads an SVG document and builds a vector scene.

    Inheritance
    Object
    SVGParser
    Namespace: Unity.VectorGraphics
    Syntax
    public class SVGParser

    Methods

    ImportSVG(TextReader, Single, Single, Int32, Int32, Boolean)

    Kicks off an SVG file import.

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

    The reader object containing the SVG file data

    Single dpi

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

    Single pixelsPerUnit

    How many SVG units fit in a Unity unit

    Int32 windowWidth

    The default with of the viewport, may be 0

    Int32 windowHeight

    The default height of the viewport, may be 0

    Boolean 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

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023