Skip to content

TextStudioCornerOffsets

StructTextStudioTextStudio
public readonly struct TextStudioCornerOffsets

Independent 2D offsets for the four vertices of a glyph quad. Values use Text Studio effect units and are applied before the glyph transform.

public static readonly TextStudioCornerOffsets Zero

Returns

TextStudio.TextStudioCornerOffsets

TextStudioCornerOffsets(Vector2, Vector2, Vector2, Vector2)

Section titled “TextStudioCornerOffsets(Vector2, Vector2, Vector2, Vector2)”
public TextStudioCornerOffsets(Vector2 bottomLeft, Vector2 topLeft, Vector2 topRight, Vector2 bottomRight)

Creates canonical bottom-left, top-left, top-right, and bottom-right offsets in effect units.

Parameters

Name Type
bottomLeft UnityEngine.Vector2
topLeft UnityEngine.Vector2
topRight UnityEngine.Vector2
bottomRight UnityEngine.Vector2

public Vector2 GetCanonicalVertexOffset(int vertexIndex)

Gets an offset using canonical TMP quad vertex order, or zero for an invalid index.

Parameters

Name Type
vertexIndex System.Int32

Returns

UnityEngine.Vector2

Add(in TextStudioCornerOffsets, in TextStudioCornerOffsets)

Section titled “Add(in TextStudioCornerOffsets, in TextStudioCornerOffsets)”
public static TextStudioCornerOffsets Add(in TextStudioCornerOffsets a, in TextStudioCornerOffsets b)

Adds corresponding corner offsets.

Parameters

Name Type
a TextStudio.TextStudioCornerOffsets
b TextStudio.TextStudioCornerOffsets

Returns

TextStudio.TextStudioCornerOffsets

public static TextStudioCornerOffsets Scale(in TextStudioCornerOffsets value, float scale)

Multiplies every corner offset by one scalar.

Parameters

Name Type
value TextStudio.TextStudioCornerOffsets
scale System.Single

Returns

TextStudio.TextStudioCornerOffsets

Multiply(in TextStudioCornerOffsets, in TextStudioCornerOffsets)

Section titled “Multiply(in TextStudioCornerOffsets, in TextStudioCornerOffsets)”
public static TextStudioCornerOffsets Multiply(in TextStudioCornerOffsets a, in TextStudioCornerOffsets b)

Multiplies corresponding corner offset components.

Parameters

Name Type
a TextStudio.TextStudioCornerOffsets
b TextStudio.TextStudioCornerOffsets

Returns

TextStudio.TextStudioCornerOffsets

Lerp(in TextStudioCornerOffsets, in TextStudioCornerOffsets, float)

Section titled “Lerp(in TextStudioCornerOffsets, in TextStudioCornerOffsets, float)”
public static TextStudioCornerOffsets Lerp(in TextStudioCornerOffsets a, in TextStudioCornerOffsets b, float t)

Interpolates corresponding corners with a clamped normalized amount.

Parameters

Name Type
a TextStudio.TextStudioCornerOffsets
b TextStudio.TextStudioCornerOffsets
t System.Single

Returns

TextStudio.TextStudioCornerOffsets

public Vector2 BottomLeft { get; }

Returns

UnityEngine.Vector2

public Vector2 TopLeft { get; }

Returns

UnityEngine.Vector2

public Vector2 TopRight { get; }

Returns

UnityEngine.Vector2

public Vector2 BottomRight { get; }

Returns

UnityEngine.Vector2