phaser/v3/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextCreator.js

20 lines
655 B
JavaScript
Raw Normal View History

var BitmapText = require('./DynamicBitmapText');
var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
var BuildGameObject = require('../../BuildGameObject');
var DynamicBitmapTextCreator = function (state, config)
{
var font = GetAdvancedValue(config, 'font', '');
var text = GetAdvancedValue(config, 'text', '');
var size = GetAdvancedValue(config, 'size', false);
var align = GetAdvancedValue(config, 'align', 'left');
var bitmapText = new BitmapText(state, 0, 0, font, text, size, align);
BuildGameObject(state, bitmapText, config);
return bitmapText;
};
module.exports = DynamicBitmapTextCreator;