forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphicsFactory.js
More file actions
37 lines (33 loc) · 1.61 KB
/
Copy pathGraphicsFactory.js
File metadata and controls
37 lines (33 loc) · 1.61 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
/**
* @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.Graphics.FACTORY_KEY = 'graphics';
/**
* Creates a new Graphics object.
*
* @method Phaser.GameObject.Factory#graphics
* @param {number} [x=0] - The x coordinate of the Graphic. The coordinate is relative to any parent container this object may be in.
* @param {number} [y=0] - The y coordinate of the Graphic. The coordinate is relative to any parent container this object may be in.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
* @return {Phaser.Graphics} The newly created graphics object.
*/
Phaser.GameObject.Graphics.FACTORY_ADD = function (x, y, group)
{
if (group === undefined) { group = this.world; }
return group.add(new Phaser.GameObject.Graphics(this.game, x, y));
};
/**
* Creates a new Graphics object.
*
* @method Phaser.GameObject.Factory#graphics
* @param {number} [x=0] - The x coordinate of the Graphic. The coordinate is relative to any parent container this object may be in.
* @param {number} [y=0] - The y coordinate of the Graphic. The coordinate is relative to any parent container this object may be in.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
* @return {Phaser.Graphics} The newly created graphics object.
*/
Phaser.GameObject.Graphics.FACTORY_MAKE = function (x, y)
{
return new Phaser.GameObject.Graphics(this.game, x, y);
};