Phaser API Documentation

  Version: 
setWordWrapWidth(width, [useAdvancedWrap])

Description:

Set the width (in pixels) to use for wrapping lines.

Pass in null to remove wrapping by width.

Parameters:

name type arguments Default description
width number

The maximum width of a line in pixels. Set to null to remove wrapping.

useAdvancedWrap boolean <optional> false

Whether or not to use the advanced wrapping algorithm. If true, spaces are collapsed and whitespace is trimmed from lines. If false, spaces and whitespace are left as is.

Returns:
Description:

The parent Text object.

Since: 3.0.0