-
Notifications
You must be signed in to change notification settings - Fork 7.1k
/
TextWordWrap.js
22 lines (21 loc) · 981 Bytes
/
TextWordWrap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* A Text Word Wrap configuration object as used by the Text Style configuration.
*
* @typedef {object} Phaser.Types.GameObjects.Text.TextWordWrap
* @since 3.0.0
*
* @property {number} [width] - The width at which text should be considered for word-wrapping.
* @property {TextStyleWordWrapCallback} [callback] - Provide a custom callback when word wrapping is enabled.
* @property {any} [callbackScope] - The context in which the word wrap callback is invoked.
* @property {boolean} [useAdvancedWrap=false] - Use basic or advanced word wrapping?
*/
/**
* A custom function that will be responsible for wrapping the text.
* @callback TextStyleWordWrapCallback
*
* @param {string} text - The string to wrap.
* @param {Phaser.GameObjects.Text} textObject - The Text instance.
*
* @return {(string|string[])} Should return the wrapped lines either as an array of lines or as a string with
* newline characters in place to indicate where breaks should happen.
*/