Skip to content

Commit 6ccb0f2

Browse files
committed
Accepts optional children array
1 parent e0f95bb commit 6ccb0f2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/gameobjects/container/ContainerFactory.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ var GameObjectFactory = require('../GameObjectFactory');
1818
*
1919
* @param {number} x - The horizontal position of this Game Object in the world.
2020
* @param {number} y - The vertical position of this Game Object in the world.
21+
* @param {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container.
2122
*
2223
* @return {Phaser.GameObjects.Container} The Game Object that was created.
2324
*/
24-
GameObjectFactory.register('container', function (x, y)
25+
GameObjectFactory.register('container', function (x, y, children)
2526
{
26-
return this.displayList.add(new Container(this.scene, x, y));
27+
return this.displayList.add(new Container(this.scene, x, y, children));
2728
});

0 commit comments

Comments
 (0)