forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextFactory.js
More file actions
40 lines (36 loc) · 1.8 KB
/
Copy pathTextFactory.js
File metadata and controls
40 lines (36 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
Phaser.GameObject.Text.FACTORY_KEY = 'text';
/**
* Creates a new Text object.
*
* @method Phaser.GameObject.Factory#text
* @param {number} [x=0] - The x coordinate of the Text. The coordinate is relative to any parent container this text may be in.
* @param {number} [y=0] - The y coordinate of the Text. The coordinate is relative to any parent container this text may be in.
* @param {string} [text=''] - The text string that will be displayed.
* @param {object} [style] - The style object containing style attributes like font, font size , etc.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
* @return {Phaser.Text} The newly created text object.
*/
Phaser.GameObject.Text.FACTORY_ADD = function (x, y, text, style, group)
{
if (group === undefined) { group = this.world; }
return group.add(new Phaser.GameObject.Text(this.game, x, y, text, style));
};
/**
* Creates a new Text object.
*
* @method Phaser.GameObject.Creator#text
* @param {number} [x=0] - The x coordinate of the Text. The coordinate is relative to any parent container this text may be in.
* @param {number} [y=0] - The y coordinate of the Text. The coordinate is relative to any parent container this text may be in.
* @param {string} [text=''] - The text string that will be displayed.
* @param {object} [style] - The style object containing style attributes like font, font size , etc.
* @return {Phaser.Text} The newly created text object.
*/
Phaser.GameObject.Text.FACTORY_MAKE = function (x, y, text, style)
{
return new Phaser.GameObject.Text(this.game, x, y, text, style);
};