Skip to content

Commit 2b99623

Browse files
committed
Group now extends EventEmitter, allowing you to emit custom events from within a Group.
1 parent de46453 commit 2b99623

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/gameobjects/group/Group.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
var Actions = require('../../actions/');
88
var Class = require('../../utils/Class');
99
var Events = require('../events');
10+
var EventEmitter = require('eventemitter3');
1011
var GetAll = require('../../utils/array/GetAll');
1112
var GetFastValue = require('../../utils/object/GetFastValue');
1213
var GetValue = require('../../utils/object/GetValue');
@@ -25,6 +26,7 @@ var Sprite = require('../sprite/Sprite');
2526
*
2627
* @class Group
2728
* @memberof Phaser.GameObjects
29+
* @extends Phaser.Events.EventEmitter
2830
* @constructor
2931
* @since 3.0.0
3032
* @param {Phaser.Scene} scene - The scene this group belongs to.
@@ -36,10 +38,14 @@ var Sprite = require('../sprite/Sprite');
3638
*/
3739
var Group = new Class({
3840

41+
Extends: EventEmitter,
42+
3943
initialize:
4044

4145
function Group (scene, children, config)
4246
{
47+
EventEmitter.call(this);
48+
4349
// They can pass in any of the following as the first argument:
4450

4551
// 1) A single child

0 commit comments

Comments
 (0)