new BitmapText(game, x, y, text, style)
Creates a new BitmapText object.
Parameters:
Name | Type | Description |
---|---|---|
game |
Phaser.Game | A reference to the currently running game. |
x |
number | X position of the new bitmapText object. |
y |
number | Y position of the new bitmapText object. |
text |
string | The actual text that will be written. |
style |
object | The style object containing style attributes like font, font size , etc. |
- 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 a sprite is alive or not, it doesn't effect rendering.
-
anchor
-
The anchor sets the origin point of the texture. The default is 0,0 this means the textures origin is the top left Setting than anchor to 0.5,0.5 means the textures origin is centered Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
- Source:
Properties:
Name Type Description anchor
Phaser.Point The anchor around which rotation and scaling takes place.
-
angle
-
Indicates the rotation of the BitmapText, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. If you wish to work in radians instead of degrees use the property Sprite.rotation instead.
- Source:
Properties:
Name Type Description angle
number Gets or sets the angle of rotation in degrees.
-
exists
-
- Default Value:
- true
- Source:
Properties:
Name Type Description exists
boolean If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all.
-
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 BitmapText.
-
name
-
- Source:
Properties:
Name Type Description name
string The user defined name given to this BitmapText.
-
renderable
-
- Source:
Properties:
Name Type Description renderable
boolean A renderable object will be rendered to the context each frame.
-
scale
-
- Source:
Properties:
Name Type Description scale
Phaser.Point The scale of the object when rendered. By default it's set to 1 (no scale). You can modify it via scale.x or scale.y or scale.setTo(x, y). A value of 1 means no change to the scale, 0.5 means "half the size", 2 means "twice the size", etc.
-
<readonly> type
-
- Source:
Properties:
Name Type Description type
number The const type of this object.
-
x
-
The x coordinate of this object in world space.
- Source:
Properties:
Name Type Description x
number The x coordinate of this object in world space.
-
y
-
The y coordinate of this object in world space.
- Source:
Properties:
Name Type Description y
number The y coordinate of this object in world space.
Methods
-
update()
-
Automatically called by World.update
- Source: