Class SVGParser
Reads an SVG document and builds a vector scene.
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 |