mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 07:04:31 +00:00
Merge pull request #5194 from mikewesthad/types-fix-wordwrap
Update TextStyle to have jsdocs for word wrap related properties
This commit is contained in:
commit
be158f48e6
1 changed files with 52 additions and 0 deletions
|
@ -294,6 +294,58 @@ var TextStyle = new Class({
|
|||
*/
|
||||
this.baselineY;
|
||||
|
||||
/**
|
||||
* The maximum width of a line of text in pixels. Null means no line wrapping. Setting this
|
||||
* property directly will not re-run the word wrapping algorithm. To change the width and
|
||||
* re-wrap, use {@link Phaser.GameObjects.TextStyle#setWordWrapWidth}.
|
||||
*
|
||||
* @name Phaser.GameObjects.TextStyle#wordWrapWidth
|
||||
* @type {number | null}
|
||||
* @default null
|
||||
* @since 3.23.0
|
||||
*/
|
||||
this.wordWrapWidth;
|
||||
|
||||
/**
|
||||
* A custom function that will be responsible for wrapping the text. It will receive two
|
||||
* arguments: text (the string to wrap), textObject (this Text instance). It 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. Setting this directly will not re-run the
|
||||
* word wrapping algorithm. To change the callback and re-wrap, use
|
||||
* {@link Phaser.GameObjects.TextStyle#setWordWrapCallback}.
|
||||
*
|
||||
* @name Phaser.GameObjects.TextStyle#wordWrapCallback
|
||||
* @type {TextStyleWordWrapCallback | null}
|
||||
* @default null
|
||||
* @since 3.23.0
|
||||
*/
|
||||
this.wordWrapCallback;
|
||||
|
||||
/**
|
||||
* The scope that will be applied when the wordWrapCallback is invoked. Setting this directly will not re-run the
|
||||
* word wrapping algorithm. To change the callback and re-wrap, use
|
||||
* {@link Phaser.GameObjects.TextStyle#setWordWrapCallback}.
|
||||
*
|
||||
* @name Phaser.GameObjects.TextStyle#wordWrapCallbackScope
|
||||
* @type {object | null}
|
||||
* @default null
|
||||
* @since 3.23.0
|
||||
*/
|
||||
this.wordWrapCallbackScope;
|
||||
|
||||
/**
|
||||
* 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. Setting
|
||||
* this property directly will not re-run the word wrapping algorithm. To change the
|
||||
* advanced setting and re-wrap, use {@link Phaser.GameObjects.TextStyle#setWordWrapWidth}.
|
||||
*
|
||||
* @name Phaser.GameObjects.TextStyle#wordWrapUseAdvanced
|
||||
* @type {boolean}
|
||||
* @default false
|
||||
* @since 3.23.0
|
||||
*/
|
||||
this.wordWrapUseAdvanced;
|
||||
|
||||
/**
|
||||
* The font style, size and family.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue