Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ImportSVG

Kicks off an SVG file import.
Read time 1 minuteLast updated 14 days ago

Definition

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

Kicks off an SVG file import.
public static SVGParser.SceneInfo ImportSVG(TextReader textReader, float dpi = 0, float pixelsPerUnit = 1, int windowWidth = 0, int windowHeight = 0, bool clipViewport = false)

Parameters

textReader

The reader object containing the SVG file data

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

pixelsPerUnit

How many SVG units fit in a Unity unit

windowWidth

The default with of the viewport, may be 0

windowHeight

The default height of the viewport, may be 0

clipViewport

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

Returns

Type

Description

SceneInfoA SceneInfo object containing the scene data

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

Kicks off an SVG file import.
public static SVGParser.SceneInfo ImportSVG(TextReader textReader, ViewportOptions viewportOptions, float dpi = 0, float pixelsPerUnit = 1, int windowWidth = 0, int windowHeight = 0)

Parameters

textReader

The reader object containing the SVG file data

viewportOptions

The viewport options to use

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

pixelsPerUnit

How many SVG units fit in a Unity unit

windowWidth

The default with of the viewport, may be 0

windowHeight

The default height of the viewport, may be 0

Returns

Type

Description

SceneInfoA SceneInfo object containing the scene data