RenderSpriteToTexture2D(Sprite, int, int, Material, int, bool)
Renders a vector sprite to Texture2D.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: Unity.VectorGraphics
- Assembly: UnityEngine.VectorGraphicsModule
public static Texture2D RenderSpriteToTexture2D(Sprite sprite, int width, int height, Material mat, int antiAliasing = 1, bool expandEdges = false)
Parameters
The sprite to render
The desired width of the resulting texture
The desired height of the resulting texture
The material used to render the sprite
The number of samples per pixel for anti-aliasing
When true, expand the edges to avoid a dark banding effect caused by filtering. This is slower to render and uses more graphics memory.
Returns
Type | Description |
|---|---|
| Texture2D | A Texture2D object containing the rendered vector sprite |