pixi-jsFunctions
Function: wordWrap()
> wordWrap(text, style, canvas, measureTextFn, canBreakWordsFn, canBreakCharsFn, wordWrapSplitFn): string
Defined in: node_modules/pixi.js/lib/scene/text/canvas/utils/wordWrap.d.ts:22
Internal
Applies newlines to a string to have it optimally fit into the horizontal bounds set by the Text object's wordWrapWidth property.
Parameters
text
string
String to apply word wrapping to
style
the style to use when wrapping
canvas
specification of the canvas to use for measuring.
measureTextFn
Function to measure text width
canBreakWordsFn
CanBreakWordsFn
Function to check if words can be broken
canBreakCharsFn
Function to check if characters can be broken
wordWrapSplitFn
Function to split words into characters
Returns
string
New string with new lines applied where required