Skip to content
pixi-silk
GitHub repository
Interface

CaretHit

import type { CaretHit } from 'pixi-silk/text';

Where a point lands in a TextLayout: the nearest caret position.

Properties#

PropertyTypeDescriptionDefined in
beforebooleanTrue when the point is left of the caret: the character under the point ends at index.text/layout.ts:329
indexnumberSource offset of the caret.text/layout.ts:320
linenumberLine the point is on.text/layout.ts:322
upstreambooleanTrue 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