Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

VectorUtils.BuildVectorImage

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static VectorImage BuildVectorImage(IEnumerable<Geometry> geoms, uint gradientResolution);

Parameters

Parameter Description
geoms The list of tessellated Geometry instances
gradientResolution The maximum size of the texture holding gradient data

Returns

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

Description

Builds a sprite asset from a scene tessellation.

It is the caller's responsibility to destroy the returned VectorImage using Object.Destroy.


Declaration

public static VectorImage BuildVectorImage(SceneInfo sceneInfo);

Parameters

Parameter Description
sceneInfo The SceneInfo to build the VectorImage from.

Returns

VectorImage A VectorImage constructed from the vector scene definition.

Description

Builds an antialiased VectorImage from a vector scene definition.


Declaration

public static VectorImage BuildVectorImage(SceneInfo sceneInfo, Rect viewport);

Parameters

Parameter Description
sceneInfo The SceneInfo to build the VectorImage from.
viewport The viewport rectangle to preserve on the resulting VectorImage. The scene contents are positioned relative to the viewport origin, and the resulting UIElements.VectorImage._size matches the viewport size. Pass Rect.zero to compute the viewport from the scene contents.

Returns

VectorImage A VectorImage constructed from the vector scene definition.

Description

Builds an antialiased VectorImage from a vector scene definition, preserving the specified viewport.

The viewport determines the size and offset of the resulting VectorImage, but does not clip its content: geometry falling outside the viewport is still included in the vertex data. To clip the scene to the viewport, assign a SceneNode.Clipper to SVGParser.SceneInfo.Scene's Scene.Root before calling this method.