Skip to content

PlacementContext

StructTextStudioTextStudio
public readonly struct PlacementContext

Shared input for placement strategies. Keeps per-glyph positions contiguous while allowing path strategies to preserve rendered line boundaries.

public readonly Vector3[] layoutPositions

Returns

UnityEngine.Vector3[]

public readonly int glyphCount

Returns

System.Int32

public readonly LineRange[] lineRanges

Returns

TextStudio.LineRange[]

public readonly int lineCount

Returns

System.Int32

public readonly float autoFitGlyphMargin

Returns

System.Single

public readonly float[] sourceCenterBaselineOffsets

Returns

System.Single[]

public readonly TextStudioGlyphVisualBounds[] sourceVisualBounds

Returns

TextStudio.TextStudioGlyphVisualBounds[]

public readonly bool[] sourceLayoutValidity

Returns

System.Boolean[]

public readonly Vector2 sourceAlignment

Normalized source-layout anchor, where (0, 0) is bottom-left and (1, 1) is top-right.

Returns

UnityEngine.Vector2

public bool HasSourceLayout(int unit)

Reports whether the unit index is in range and has valid native source-layout data.

Parameters

Name Type
unit System.Int32

Returns

System.Boolean

PlacementContext(Vector3[], int, LineRange[], int, float, float[], Vector2?, TextStudioGlyphVisualBounds[])

Section titled “PlacementContext(Vector3[], int, LineRange[], int, float, float[], Vector2?, TextStudioGlyphVisualBounds[])”
public PlacementContext(Vector3[] layoutPositions, int glyphCount, LineRange[] lineRanges = null, int lineCount = 0, float autoFitGlyphMargin = 0, float[] sourceCenterBaselineOffsets = null, Vector2? sourceAlignment = null, TextStudioGlyphVisualBounds[] sourceVisualBounds = null)

Creates transient placement input, clamping counts to supplied arrays and using centered alignment by default.

Parameters

Name Type
layoutPositions UnityEngine.Vector3[]
glyphCount System.Int32
lineRanges TextStudio.LineRange[]
lineCount System.Int32
autoFitGlyphMargin System.Single
sourceCenterBaselineOffsets System.Single[]
sourceAlignment System.Nullable{UnityEngine.Vector2}
sourceVisualBounds TextStudio.TextStudioGlyphVisualBounds[]

PlacementContext(Vector3[], int, LineRange[], int, float, float[], Vector2?, TextStudioGlyphVisualBounds[], bool[])

Section titled “PlacementContext(Vector3[], int, LineRange[], int, float, float[], Vector2?, TextStudioGlyphVisualBounds[], bool[])”
public PlacementContext(Vector3[] layoutPositions, int glyphCount, LineRange[] lineRanges, int lineCount, float autoFitGlyphMargin, float[] sourceCenterBaselineOffsets, Vector2? sourceAlignment, TextStudioGlyphVisualBounds[] sourceVisualBounds, bool[] sourceLayoutValidity)

Creates placement input with explicit measured-layout coverage for each semantic unit.

Parameters

Name Type
layoutPositions UnityEngine.Vector3[]
glyphCount System.Int32
lineRanges TextStudio.LineRange[]
lineCount System.Int32
autoFitGlyphMargin System.Single
sourceCenterBaselineOffsets System.Single[]
sourceAlignment System.Nullable{UnityEngine.Vector2}
sourceVisualBounds TextStudio.TextStudioGlyphVisualBounds[]
sourceLayoutValidity System.Boolean[]