mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 13:43:26 +00:00
Accepts optional children array
This commit is contained in:
parent
e0f95bb3fa
commit
6ccb0f2dc4
1 changed files with 3 additions and 2 deletions
|
@ -18,10 +18,11 @@ var GameObjectFactory = require('../GameObjectFactory');
|
|||
*
|
||||
* @param {number} x - The horizontal position of this Game Object in the world.
|
||||
* @param {number} y - The vertical position of this Game Object in the world.
|
||||
* @param {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)
|
||||
GameObjectFactory.register('container', function (x, y, children)
|
||||
{
|
||||
return this.displayList.add(new Container(this.scene, x, y));
|
||||
return this.displayList.add(new Container(this.scene, x, y, children));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue