Back to API Reference
Struct

TextHitResult

sealed

Result of a text hit test operation.

Remarks

Returned by HitTest and HitTestScreen to identify which glyph/cluster was hit by a pointer.
[ctor]public TextHitResult()
public readonly bool hit

True if a glyph was hit.

public readonly int glyphIndex

Index of the hit glyph in the positioned glyphs array.

public readonly int cluster

Cluster index (codepoint offset in source text).

public readonly Vector2 glyphPosition

Position of the hit glyph.

public readonly float distance

Distance from the hit point to the glyph center.

public static readonly TextHitResult None

Represents no hit.