CaretHit
import type { CaretHit } from 'pixi-silk/text';
Where a point lands in a TextLayout: the nearest caret position.
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
before | boolean | True when the point is left of the caret: the character under the point ends at index. | text/layout.ts:329 |
index | number | Source offset of the caret. | text/layout.ts:320 |
line | number | Line the point is on. | text/layout.ts:322 |
upstream | boolean | True when the caret belongs at the end of line although the next line starts at the same offset (a wrap). Pass it back to caretRect to draw the caret where the point was. | text/layout.ts:327 |