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

23 lines
462 B
JavaScript
Raw Normal View History

var Text = require('./Text');
var BuildFromConfig = require('./BuildFromConfig');
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 (config)
{
return BuildFromConfig(this.state, config);
}
};
module.exports = FactoryContainer.register(TextFactory);