From 6ccb0f2dc47cf0efc0a45b2cc323eba88ae3a064 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Thu, 5 Apr 2018 13:52:24 +0100 Subject: [PATCH] Accepts optional children array --- src/gameobjects/container/ContainerFactory.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gameobjects/container/ContainerFactory.js b/src/gameobjects/container/ContainerFactory.js index eca71f82d..cc197854b 100644 --- a/src/gameobjects/container/ContainerFactory.js +++ b/src/gameobjects/container/ContainerFactory.js @@ -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)); });