forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroupFactory.js
More file actions
21 lines (18 loc) · 720 Bytes
/
Copy pathGroupFactory.js
File metadata and controls
21 lines (18 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var Group = require('./Group');
var GameObjectFactory = require('../GameObjectFactory');
// When registering a factory function 'this' refers to the GameObjectFactory context.
//
// There are several properties available to use:
//
// this.scene - a reference to the Scene that owns the GameObjectFactory
// this.displayList - a reference to the Display List the Scene owns
// this.updateList - a reference to the Update List the Scene owns
GameObjectFactory.register('group', function (children, config)
{
if (typeof children === 'object' && config === undefined)
{
config = children;
children = [];
}
return this.updateList.add(new Group(this.scene, children, config));
});