Svg

Summary

Functions related to SVG images

Class Methods

Svg:ParsePathString(svgPath)

Parses an SVG path string

Returns: PathList (Returns a PathList representing the parsed SVG path)

Parameters:

NameTypeDefaultDescription

svgPath

string

The SVG path string to parse

Example

myPaths = SVG:ParsePathString('M 100 100 L 200 200')

Svg:ParseDocument(svg, offsetPerPath, includeColors)

Parses an SVG document

Returns: PathList (Returns a PathList representing the parsed SVG document)

Parameters:

NameTypeDefaultDescription

svg

string

A text string that is valid SVG document

offsetPerPath

number

0

Each path can be lifted to form a layered result

includeColors

boolean

false

Whether the colors from the SVG are used

Example

myPaths = SVG:ParseDocument('...')

Svg:DrawPathString(svg, tr)

Draws an SVG path string

Returns: nil

Parameters:

NameTypeDefaultDescription

svg

string

The SVG path string to draw

tr

The transform to apply to the result

Example

Svg:DrawPathString('M 100 100 L 200 200')

Svg:DrawDocument(svg, tr)

Draws an SVG document

Returns: nil

Parameters:

NameTypeDefaultDescription

svg

string

A text string that is a valid SVG document

tr

The transform (position, rotation and scale) to apply to the result

Example

Svg:Draw('...')

Last updated