mirror of
https://github.com/photonstorm/phaser
synced 2024-12-18 17:16:03 +00:00
35 lines
791 B
JavaScript
35 lines
791 B
JavaScript
|
var Class = require('../../utils/Class');
|
||
|
var GameObject = require('../GameObject');
|
||
|
var Components = require('../../components');
|
||
|
var Renderer = require('./BitmapTextRenderer')
|
||
|
|
||
|
var BitmapText = new Class({
|
||
|
|
||
|
Mixins: [
|
||
|
Components.Transform,
|
||
|
Components.Texture,
|
||
|
Components.Size,
|
||
|
Components.Alpha,
|
||
|
Components.BlendMode,
|
||
|
Components.ScaleMode,
|
||
|
Components.Visible,
|
||
|
Renderer
|
||
|
],
|
||
|
|
||
|
initialize:
|
||
|
|
||
|
function BitmapText (state, x, y, key, text)
|
||
|
{
|
||
|
GameObject.call(this, state);
|
||
|
|
||
|
this.text = typeof text === 'string' ? text : '';
|
||
|
this.fontData = this.state.sys.cache.xml.get(key);
|
||
|
|
||
|
this.setTexture(key, null);
|
||
|
this.setPosition(x, y);
|
||
|
}
|
||
|
|
||
|
});
|
||
|
|
||
|
module.exports = BitmapText;
|