Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


BuildSprite

Builds a sprite asset from a scene tessellation.
Read time 1 minuteLast updated 6 days ago

Definition

BuildSprite(List<Geometry>, float, Alignment, Vector2, ushort, bool)

Builds a sprite asset from a scene tessellation.
public static Sprite BuildSprite(List<VectorUtils.Geometry> geoms, float svgPixelsPerUnit, VectorUtils.Alignment alignment, Vector2 customPivot, ushort gradientResolution, bool flipYAxis = false)

Parameters

The list of tessellated Geometry instances

svgPixelsPerUnit

How many SVG "pixels" map into a Unity unit

alignment

The position of the sprite origin

customPivot

If alignment is VectorUtils.Alignment.Custom, customPivot is used to compute the sprite origin

gradientResolution

The maximum size of the texture holding gradient data

flipYAxis

True to have the positive Y axis to go downward.

Returns

Type

Description

SpriteA new Sprite containing the provided geometry. The Sprite may have a texture if the geometry has any texture and/or gradients

BuildSprite(List<Geometry>, Rect, float, Alignment, Vector2, ushort, bool)

Builds a sprite asset from a scene tessellation.
public static Sprite BuildSprite(List<VectorUtils.Geometry> geoms, Rect rect, float svgPixelsPerUnit, VectorUtils.Alignment alignment, Vector2 customPivot, ushort gradientResolution, bool flipYAxis = false)

Parameters

The list of tessellated Geometry instances

rect

The position and size of the sprite geometry

svgPixelsPerUnit

How many SVG "pixels" map into a Unity unit

alignment

The position of the sprite origin

customPivot

If alignment is VectorUtils.Alignment.Custom, customPivot is used to compute the sprite origin

gradientResolution

The maximum size of the texture holding gradient data

flipYAxis

True to have the positive Y axis to go downward.

Returns

Type

Description

SpriteA new Sprite containing the provided geometry. The Sprite may have a texture if the geometry has any texture and/or gradients