addStrokeColor(color, position) → {Phaser.Text}
Set specific stroke colors for certain characters within the Text.
It works by taking a color value, which is a typical HTML string such as #ff0000
or rgb(255,0,0)
and a position.
The position value is the index of the character in the Text string to start applying this color to.
Once set the color remains in use until either another color or the end of the string is encountered.
For example if the Text was Photon Storm
and you did Text.addColor('#ffff00', 6)
it would color in the word Storm
in yellow.
This has no effect if stroke is disabled or has a thickness of 0.
If you wish to change the text fill color see addColor instead.
Parameters
Name | Type | Description |
---|---|---|
color | string | A canvas fillstyle that will be used on the text stroke eg |
position | number | The index of the character in the string to start applying this color value from. |
Returns
This Text instance.
- Source code: gameobjects/Text.js (Line 853)
Please login to continue.