Skip to content

TextStudio2DPaint

StructTextStudioTextStudio
public struct TextStudio2DPaint

Typed paint shared by fills, strokes, glows, shadows, and decorations.

public static TextStudio2DPaint Solid(Color color)

Creates solid-color paint mapped to each glyph.

Parameters

NameType
colorUnityEngine.Color

Returns

TextStudio.TextStudio2DPaint

Gradient(TextStudio2DPaintKind, TextStudio2DMappingSpace, TextStudio2DGradientStop[], float, Vector2?, Vector2?, Vector2)

Section titled “Gradient(TextStudio2DPaintKind, TextStudio2DMappingSpace, TextStudio2DGradientStop[], float, Vector2?, Vector2?, Vector2)”
public static TextStudio2DPaint Gradient(TextStudio2DPaintKind kind, TextStudio2DMappingSpace mapping, TextStudio2DGradientStop[] stops, float angle = 0, Vector2? center = null, Vector2? scale = null, Vector2 offset = null)

Creates linear, radial, or conic gradient paint with copied stops, the specified mapping and transform, and clamped spread.

Parameters

NameType
kindTextStudio.TextStudio2DPaintKind
mappingTextStudio.TextStudio2DMappingSpace
stopsTextStudio.TextStudio2DGradientStop[]
angleSystem.Single
centerSystem.Nullable{UnityEngine.Vector2}
scaleSystem.Nullable{UnityEngine.Vector2}
offsetUnityEngine.Vector2

Returns

TextStudio.TextStudio2DPaint

Gradient(TextStudio2DPaintKind, TextStudio2DMappingSpace, TextStudio2DGradientStop[], float, Vector2?, Vector2?, Vector2, TextStudio2DGradientSpread)

Section titled “Gradient(TextStudio2DPaintKind, TextStudio2DMappingSpace, TextStudio2DGradientStop[], float, Vector2?, Vector2?, Vector2, TextStudio2DGradientSpread)”
public static TextStudio2DPaint Gradient(TextStudio2DPaintKind kind, TextStudio2DMappingSpace mapping, TextStudio2DGradientStop[] stops, float angle, Vector2? center, Vector2? scale, Vector2 offset, TextStudio2DGradientSpread spread)

Creates linear, radial, or conic gradient paint with copied stops and the specified mapping, transform, and spread mode.

Parameters

NameType
kindTextStudio.TextStudio2DPaintKind
mappingTextStudio.TextStudio2DMappingSpace
stopsTextStudio.TextStudio2DGradientStop[]
angleSystem.Single
centerSystem.Nullable{UnityEngine.Vector2}
scaleSystem.Nullable{UnityEngine.Vector2}
offsetUnityEngine.Vector2
spreadTextStudio.TextStudio2DGradientSpread

Returns

TextStudio.TextStudio2DPaint

FourCorner(TextStudio2DMappingSpace, TextStudio2DFourCornerGradient, Vector2?, Vector2?, Vector2)

Section titled “FourCorner(TextStudio2DMappingSpace, TextStudio2DFourCornerGradient, Vector2?, Vector2?, Vector2)”
public static TextStudio2DPaint FourCorner(TextStudio2DMappingSpace mapping, TextStudio2DFourCornerGradient gradient, Vector2? center = null, Vector2? scale = null, Vector2 offset = null)

Creates paint that interpolates four corner colors within the specified mapping space and transform.

Parameters

NameType
mappingTextStudio.TextStudio2DMappingSpace
gradientTextStudio.TextStudio2DFourCornerGradient
centerSystem.Nullable{UnityEngine.Vector2}
scaleSystem.Nullable{UnityEngine.Vector2}
offsetUnityEngine.Vector2

Returns

TextStudio.TextStudio2DPaint

DistanceGradient(TextStudio2DDistanceDomain, TextStudio2DGradientStop[], Vector2, TextStudio2DGradientSpread)

Section titled “DistanceGradient(TextStudio2DDistanceDomain, TextStudio2DGradientStop[], Vector2, TextStudio2DGradientSpread)”
public static TextStudio2DPaint DistanceGradient(TextStudio2DDistanceDomain domain, TextStudio2DGradientStop[] stops, Vector2 distanceRange, TextStudio2DGradientSpread spread = TextStudio2DGradientSpread.Clamp)

Creates a gradient driven by a layer-specific signed-distance measurement.

Parameters

NameType
domainTextStudio.TextStudio2DDistanceDomain
stopsTextStudio.TextStudio2DGradientStop[]
distanceRangeUnityEngine.Vector2
spreadTextStudio.TextStudio2DGradientSpread

Returns

TextStudio.TextStudio2DPaint

TexturePaint(Texture2D, string, TextStudio2DMappingSpace, Vector2?, Vector2, Color?)

Section titled “TexturePaint(Texture2D, string, TextStudio2DMappingSpace, Vector2?, Vector2, Color?)”
public static TextStudio2DPaint TexturePaint(Texture2D texture, string stableResourceId, TextStudio2DMappingSpace mapping = TextStudio2DMappingSpace.Glyph, Vector2? scale = null, Vector2 offset = null, Color? tint = null)

Creates texture paint with a stable resource identifier, mapping space, scale, offset, and optional tint.

Parameters

NameType
textureUnityEngine.Texture2D
stableResourceIdSystem.String
mappingTextStudio.TextStudio2DMappingSpace
scaleSystem.Nullable{UnityEngine.Vector2}
offsetUnityEngine.Vector2
tintSystem.Nullable{UnityEngine.Color}

Returns

TextStudio.TextStudio2DPaint

PatternPaint(Texture2D, string, TextStudio2DMappingSpace, Vector2?, Vector2, Color?)

Section titled “PatternPaint(Texture2D, string, TextStudio2DMappingSpace, Vector2?, Vector2, Color?)”
public static TextStudio2DPaint PatternPaint(Texture2D texture, string stableResourceId, TextStudio2DMappingSpace mapping = TextStudio2DMappingSpace.Glyph, Vector2? scale = null, Vector2 offset = null, Color? tint = null)

Creates pattern paint with a stable texture resource identifier, mapping space, scale, offset, and optional tint.

Parameters

NameType
textureUnityEngine.Texture2D
stableResourceIdSystem.String
mappingTextStudio.TextStudio2DMappingSpace
scaleSystem.Nullable{UnityEngine.Vector2}
offsetUnityEngine.Vector2
tintSystem.Nullable{UnityEngine.Color}

Returns

TextStudio.TextStudio2DPaint

Noise(Color, float, float, int, TextStudio2DMappingSpace)

Section titled “Noise(Color, float, float, int, TextStudio2DMappingSpace)”
public static TextStudio2DPaint Noise(Color color, float scale, float detail, int seed, TextStudio2DMappingSpace mapping = TextStudio2DMappingSpace.Text)

Creates deterministic procedural noise paint with the specified color, frequency, detail, seed, and mapping space.

Parameters

NameType
colorUnityEngine.Color
scaleSystem.Single
detailSystem.Single
seedSystem.Int32
mappingTextStudio.TextStudio2DMappingSpace

Returns

TextStudio.TextStudio2DPaint

public TextStudio2DGradientStop GetGradientStop(int index)

Returns the gradient stop at the specified index, throwing if the index is outside the stop array.

Parameters

NameType
indexSystem.Int32

Returns

TextStudio.TextStudio2DGradientStop

public TextStudio2DPaint WithSpread(TextStudio2DGradientSpread spread)

Returns a paint copy with the specified gradient spread mode marked as a local override.

Parameters

NameType
spreadTextStudio.TextStudio2DGradientSpread

Returns

TextStudio.TextStudio2DPaint

public TextStudio2DPaint WithGradientDither(bool enabled = true)

Returns a paint copy with stable screen-pixel gradient dithering marked as a local override. Alpha is unchanged. The noise spans one 8-bit display step, remains present on high-precision targets, and leaves colors outside SDR unchanged.

Parameters

NameType
enabledSystem.Boolean

Returns

TextStudio.TextStudio2DPaint

public TextStudio2DPaint WithTextureFit(TextStudio2DTextureFit fit)

Returns a paint copy with the specified texture fitting mode marked as a local override.

Parameters

NameType
fitTextStudio.TextStudio2DTextureFit

Returns

TextStudio.TextStudio2DPaint

public static TextStudio2DPaint Reference(TextStudio2DPaintAsset source)

Creates a binding to a paint asset with no local overrides.

Parameters

NameType
sourceTextStudio.TextStudio2DPaintAsset

Returns

TextStudio.TextStudio2DPaint

public TextStudio2DPaint WithOverrides(TextStudio2DPaintOverrides overrides)

Returns a paint copy with the specified set of local overrides for referenced paint.

Parameters

NameType
overridesTextStudio.TextStudio2DPaintOverrides

Returns

TextStudio.TextStudio2DPaint

WithMapping(TextStudio2DMappingSpace, TextStudio2DRangeMapping)

Section titled “WithMapping(TextStudio2DMappingSpace, TextStudio2DRangeMapping)”
public TextStudio2DPaint WithMapping(TextStudio2DMappingSpace mapping, TextStudio2DRangeMapping range = TextStudio2DRangeMapping.EachMatch)

Returns a paint copy with locally overridden mapping space and range mapping behavior.

Parameters

NameType
mappingTextStudio.TextStudio2DMappingSpace
rangeTextStudio.TextStudio2DRangeMapping

Returns

TextStudio.TextStudio2DPaint

public TextStudio2DPaint WithTint(Color tint)

Returns a paint copy with the supplied tint marked as a local override.

Parameters

NameType
tintUnityEngine.Color

Returns

TextStudio.TextStudio2DPaint

WithTransform(float, Vector2, Vector2, Vector2)

Section titled “WithTransform(float, Vector2, Vector2, Vector2)”
public TextStudio2DPaint WithTransform(float angle, Vector2 center, Vector2 scale, Vector2 offset)

Returns a paint copy with locally overridden angle, center, scale, and offset.

Parameters

NameType
angleSystem.Single
centerUnityEngine.Vector2
scaleUnityEngine.Vector2
offsetUnityEngine.Vector2

Returns

TextStudio.TextStudio2DPaint

public TextStudio2DPaint MakeLocal()

Copies the resolved value and severs the asset reference.

Returns

TextStudio.TextStudio2DPaint

public TextStudio2DPaintKind Kind { get; }

Returns

TextStudio.TextStudio2DPaintKind

public TextStudio2DMappingSpace Mapping { get; }

Returns

TextStudio.TextStudio2DMappingSpace

public TextStudio2DGradientSpread Spread { get; }

Returns

TextStudio.TextStudio2DGradientSpread

public bool GradientDither { get; }

Returns

System.Boolean

public Color Color { get; }

Returns

UnityEngine.Color

public int GradientStopCount { get; }

Returns

System.Int32

public TextStudio2DFourCornerGradient FourCornerGradient { get; }

Returns

TextStudio.TextStudio2DFourCornerGradient

public float Angle { get; }

Returns

System.Single

public Vector2 Center { get; }

Returns

UnityEngine.Vector2

public Vector2 Scale { get; }

Returns

UnityEngine.Vector2

public Vector2 Offset { get; }

Returns

UnityEngine.Vector2

public Texture2D Texture { get; }

Returns

UnityEngine.Texture2D

public string ResourceId { get; }

Returns

System.String

public TextStudio2DTextureFit TextureFit { get; }

Returns

TextStudio.TextStudio2DTextureFit

public TextStudio2DDistanceDomain DistanceDomain { get; }

Returns

TextStudio.TextStudio2DDistanceDomain

public Vector2 DistanceRange { get; }

Returns

UnityEngine.Vector2

public float NoiseScale { get; }

Returns

System.Single

public float NoiseDetail { get; }

Returns

System.Single

public int NoiseSeed { get; }

Returns

System.Int32

public TextStudio2DPaintAsset Source { get; }

Returns

TextStudio.TextStudio2DPaintAsset

public bool UsesSharedSource { get; }

Returns

System.Boolean

public TextStudio2DPaintOverrides Overrides { get; }

Returns

TextStudio.TextStudio2DPaintOverrides

public TextStudio2DRangeMapping RangeMapping { get; }

Returns

TextStudio.TextStudio2DRangeMapping