mirror of
https://github.com/photonstorm/phaser
synced 2024-12-27 13:33:35 +00:00
20 lines
655 B
JavaScript
20 lines
655 B
JavaScript
|
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;
|