phaser/v3/src/gameobjects/bitmaptext/BitmapTextFactory.js

21 lines
532 B
JavaScript
Raw Normal View History

var BitmapText = require('./BitmapText');
var FactoryContainer = require('../../gameobjects/FactoryContainer');
var BitmapTextFactory = {
KEY: 'bitmapText',
add: function (x, y, font, text, size, align)
{
return this.state.children.add(new BitmapText(this.state, x, y, font, text, size, align));
},
make: function (x, y, font, text, size, align)
{
return new BitmapText(this.state, x, y, font, text, size, align);
}
};
module.exports = FactoryContainer.register(BitmapTextFactory);