Skip to content

TextStudioColorSource

ClassTextStudioTextStudio
public sealed class TextStudioColorSource

An immutable color image with its actual mesh and atlas UVs, expressed in source em coordinates.

TextStudioColorSource(Texture, Vector2[], Vector2[], int[], float, bool, uint)

Section titled “TextStudioColorSource(Texture, Vector2[], Vector2[], int[], float, bool, uint)”
public TextStudioColorSource(Texture texture, Vector2[] positions, Vector2[] uv, int[] triangles, float alphaThreshold = 0.5, bool premultipliedAlpha = false, uint revision = 0)

Creates a color-image source from validated, independently copied mesh positions, UVs, and triangles with alpha and revision metadata.

Parameters

Name Type
texture UnityEngine.Texture
positions UnityEngine.Vector2[]
uv UnityEngine.Vector2[]
triangles System.Int32[]
alphaThreshold System.Single
premultipliedAlpha System.Boolean
revision System.UInt32

public Texture Texture { get; }

Returns

UnityEngine.Texture

public TextStudioReadOnlyBuffer<Vector2> Positions { get; }

Returns

TextStudio.TextStudioReadOnlyBuffer{UnityEngine.Vector2}

public TextStudioReadOnlyBuffer<Vector2> Uv { get; }

Returns

TextStudio.TextStudioReadOnlyBuffer{UnityEngine.Vector2}

public TextStudioReadOnlyBuffer<int> Triangles { get; }

Returns

TextStudio.TextStudioReadOnlyBuffer{System.Int32}

public Rect Bounds { get; }

Returns

UnityEngine.Rect

public float AlphaThreshold { get; }

Returns

System.Single

public bool PremultipliedAlpha { get; }

Returns

System.Boolean

public uint Revision { get; }

Backend content revision, in addition to Unity’s texture update counter.

Returns

System.UInt32

public bool IsEmpty { get; }

Returns

System.Boolean