phaser/v3/src/gameobjects/text/BitmapText.js

35 lines
791 B
JavaScript
Raw Normal View History

2017-02-23 18:18:01 +00:00
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;