Class: BitmapText

Phaser. BitmapText

BitmapText objects work by taking a texture file and an XML file that describes the font layout.

On Windows you can use the free app BMFont: http://www.angelcode.com/products/bmfont/

On OS X we recommend Glyph Designer: http://www.71squared.com/en/glyphdesigner

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

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.

Default Value:
  • true
Source:

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

Properties:
Name Type Description
anchor Phaser.Point

The anchor around which rotation and scaling takes place.

Source:

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.

Properties:
Name Type Description
angle number

Gets or sets the angle of rotation in degrees.

Source:

exists

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.

Default Value:
  • true
Source:

game

Properties:
Name Type Description
game Phaser.Game

A reference to the currently running Game.

Source:

group

Properties:
Name Type Description
group Phaser.Group

The parent Group of this BitmapText.

Source:

name

Properties:
Name Type Description
name string

The user defined name given to this BitmapText.

Source:

scale

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.

Source:

<readonly> type

Properties:
Name Type Description
type number

The const type of this object.

Source:

x

The x coordinate of this object in world space.

Properties:
Name Type Description
x number

The x coordinate of this object in world space.

Source:

y

The y coordinate of this object in world space.

Properties:
Name Type Description
y number

The y coordinate of this object in world space.

Source:

Methods

update()

Automatically called by World.update

Source:
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Wed Feb 05 2014 06:28:25 GMT-0000 (GMT) using the DocStrap template.