PlacementContext
public readonly struct PlacementContextShared input for placement strategies. Keeps per-glyph positions contiguous while allowing path strategies to preserve rendered line boundaries.
Fields
Section titled “Fields”
layoutPositions
Section titled “layoutPositions”public readonly Vector3[] layoutPositionsReturns
UnityEngine.Vector3[]
glyphCount
Section titled “glyphCount”public readonly int glyphCountReturns
System.Int32
lineRanges
Section titled “lineRanges”public readonly LineRange[] lineRangesReturns
TextStudio.LineRange[]
lineCount
Section titled “lineCount”public readonly int lineCountReturns
System.Int32
autoFitGlyphMargin
Section titled “autoFitGlyphMargin”public readonly float autoFitGlyphMarginReturns
System.Single
sourceCenterBaselineOffsets
Section titled “sourceCenterBaselineOffsets”public readonly float[] sourceCenterBaselineOffsetsReturns
System.Single[]
sourceVisualBounds
Section titled “sourceVisualBounds”public readonly TextStudioGlyphVisualBounds[] sourceVisualBoundsReturns
TextStudio.TextStudioGlyphVisualBounds[]
sourceLayoutValidity
Section titled “sourceLayoutValidity”public readonly bool[] sourceLayoutValidityReturns
System.Boolean[]
sourceAlignment
Section titled “sourceAlignment”public readonly Vector2 sourceAlignmentNormalized source-layout anchor, where (0, 0) is bottom-left and (1, 1) is top-right.
Returns
UnityEngine.Vector2
Methods
Section titled “Methods”
HasSourceLayout(int)
Section titled “HasSourceLayout(int)”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
Constructors
Section titled “Constructors”
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[] |