forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBitmapTextCreator.js
More file actions
21 lines (16 loc) · 805 Bytes
/
Copy pathBitmapTextCreator.js
File metadata and controls
21 lines (16 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var BitmapText = require('./BitmapText');
var BuildGameObject = require('../../BuildGameObject');
var GameObjectCreator = require('../../GameObjectCreator');
var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
var GetValue = require('../../../utils/object/GetValue');
// When registering a factory function 'this' refers to the GameObjectCreator context.
GameObjectCreator.register('bitmapText', function (config)
{
var font = GetValue(config, 'font', '');
var text = GetAdvancedValue(config, 'text', '');
var size = GetAdvancedValue(config, 'size', false);
// var align = GetValue(config, 'align', 'left');
var bitmapText = new BitmapText(this.scene, 0, 0, font, text, size);
BuildGameObject(this.scene, bitmapText, config);
return bitmapText;
});