forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerFactory.js
More file actions
28 lines (26 loc) · 1.09 KB
/
Copy pathContainerFactory.js
File metadata and controls
28 lines (26 loc) · 1.09 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
/**
* @author Richard Davey <rich@photonstorm.com>
* @author Felipe Alfonso <@bitnenfer>
* @copyright 2020 Photon Storm Ltd.
* @license {@link https://opensource.org/licenses/MIT|MIT License}
*/
var Container = require('./Container');
var GameObjectFactory = require('../GameObjectFactory');
/**
* Creates a new Container Game Object and adds it to the Scene.
*
* Note: This method will only be available if the Container Game Object has been built into Phaser.
*
* @method Phaser.GameObjects.GameObjectFactory#container
* @since 3.4.0
*
* @param {number} [x=0] - The horizontal position of this Game Object in the world.
* @param {number} [y=0] - The vertical position of this Game Object in the world.
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container.
*
* @return {Phaser.GameObjects.Container} The Game Object that was created.
*/
GameObjectFactory.register('container', function (x, y, children)
{
return this.displayList.add(new Container(this.scene, x, y, children));
});