BuildSprite
Builds a sprite asset from a scene tessellation.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.VectorGraphics
- Assembly: UnityEngine.VectorGraphicsModule
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
How many SVG "pixels" map into a Unity unit
The position of the sprite origin
If alignment is VectorUtils.Alignment.Custom, customPivot is used to compute the sprite origin
The maximum size of the texture holding gradient data
True to have the positive Y axis to go downward.
Returns
Type | Description |
|---|---|
| Sprite | A 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
The position and size of the sprite geometry
How many SVG "pixels" map into a Unity unit
The position of the sprite origin
If alignment is VectorUtils.Alignment.Custom, customPivot is used to compute the sprite origin
The maximum size of the texture holding gradient data
True to have the positive Y axis to go downward.
Returns
Type | Description |
|---|---|
| Sprite | A new Sprite containing the provided geometry. The Sprite may have a texture if the geometry has any texture and/or gradients |