Skip to content
pixi-silk
GitHub repository
Function

rangeRects

import { rangeRects } from 'pixi-silk/text';
function rangeRects(
   layout: TextLayout, 
   from: number, 
   to: number, 
   newline?: number
): TextRect[];

Highlight boxes of the range from to to, one per line, the full height of each line box. A range that runs on past a newline gets a sliver of newline width at that line’s end, so selected empty lines still show. Default newline width a quarter of the font height.

Parameters#

ParameterType
layoutTextLayout
fromnumber
tonumber
newline?number

Returns#

TextRect[]