phaser/v3/src/gameobjects/text/static/TextFactory.js

21 lines
424 B
JavaScript
Raw Normal View History

var Text = require('./Text');
var FactoryContainer = require('../../FactoryContainer');
var TextFactory = {
KEY: 'text',
add: function (x, y, text, style)
{
return this.children.add(new Text(this.state, x, y, text, style));
},
make: function (x, y, text, style)
{
return new Text(this.state, x, y, text, style);
}
};
module.exports = FactoryContainer.register(TextFactory);