Class SVGParser
Reads an SVG document and builds a vector scene.
Inherited Members
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 |
---|---|---|
Text |
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
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 |
---|---|---|
Text |
textReader | The reader object containing the SVG file data |
Viewport |
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 |