2017-07-04 00:59:31 +00:00
|
|
|
var BitmapText = require('./DynamicBitmapText');
|
|
|
|
var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
|
|
|
|
var BuildGameObject = require('../../BuildGameObject');
|
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
var DynamicBitmapTextCreator = function (scene, config)
|
2017-07-04 00:59:31 +00:00
|
|
|
{
|
|
|
|
var font = GetAdvancedValue(config, 'font', '');
|
|
|
|
var text = GetAdvancedValue(config, 'text', '');
|
|
|
|
var size = GetAdvancedValue(config, 'size', false);
|
|
|
|
var align = GetAdvancedValue(config, 'align', 'left');
|
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
var bitmapText = new BitmapText(scene, 0, 0, font, text, size, align);
|
2017-07-04 00:59:31 +00:00
|
|
|
|
2017-07-14 13:30:20 +00:00
|
|
|
BuildGameObject(scene, bitmapText, config);
|
2017-07-04 00:59:31 +00:00
|
|
|
|
|
|
|
return bitmapText;
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = DynamicBitmapTextCreator;
|