new DOMSprite(game, id, x, y, text, style)
Create a new DOMSprite.
Parameters:
Name | Type | Description |
---|---|---|
game |
Phaser.Game | Current game instance. |
id |
string | DOM ID. |
x |
number | X position of the new text object. |
y |
number | Y position of the new text object. |
text |
string | The actual text that will be written. |
style |
object | The style object containing style attributes like font, font size , |
- Source:
Members
-
alive
-
- Default Value:
- true
- Source:
Properties:
Name Type Description alive
boolean This is a handy little var your game can use to determine if an object is alive or not, it doesn't effect rendering.
-
exists
-
- Default Value:
- true
- Source:
Properties:
Name Type Description exists
boolean If exists = false then the Text isn't updated by the core game loop.
-
game
-
- Source:
Properties:
Name Type Description game
Phaser.Game A reference to the currently running Game.
-
group
-
- Source:
Properties:
Name Type Description group
Phaser.Group The parent Group of this Text object.
-
name
-
- Source:
Properties:
Name Type Description name
string The user defined name given to this object.
-
type
-
- Source:
Properties:
Name Type Description type
number The const type of this object.
-
visible
-
- Default Value:
- true
- Source:
Properties:
Name Type Description visible
boolean Sets the visible state of this DOMSprite.