2016-10-08 16:19:55 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
|
|
|
* @copyright 2016 Photon Storm Ltd.
|
|
|
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
|
|
|
*/
|
2016-11-10 17:04:29 +00:00
|
|
|
Phaser.GameObject.Container = function (state, parent, x, y, name)
|
2016-10-14 01:19:35 +00:00
|
|
|
{
|
2016-11-10 17:04:29 +00:00
|
|
|
Phaser.GameObject.call(this, state, x, y, null, null, parent);
|
2016-10-08 16:19:55 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @property {number} type - The const type of this object.
|
|
|
|
* @readonly
|
|
|
|
*/
|
|
|
|
this.type = Phaser.CONTAINER;
|
|
|
|
|
2016-11-01 00:31:45 +00:00
|
|
|
this.name = name;
|
2016-10-08 16:19:55 +00:00
|
|
|
|
2016-10-14 01:19:35 +00:00
|
|
|
this.children = new Phaser.Component.Children(this);
|
2016-10-08 16:19:55 +00:00
|
|
|
};
|
|
|
|
|
2016-11-01 00:31:45 +00:00
|
|
|
Phaser.GameObject.Container.prototype = Object.create(Phaser.GameObject.prototype);
|
2016-10-09 21:27:58 +00:00
|
|
|
Phaser.GameObject.Container.prototype.constructor = Phaser.GameObject.Container;
|
2016-10-08 16:19:55 +00:00
|
|
|
|
2016-10-14 01:19:35 +00:00
|
|
|
Phaser.GameObject.Container.prototype.preUpdate = function ()
|
|
|
|
{
|
2016-10-14 05:31:01 +00:00
|
|
|
if (this.parent)
|
|
|
|
{
|
2016-11-01 00:31:45 +00:00
|
|
|
this.color.worldAlpha = this.parent.color.worldAlpha;
|
2016-10-14 05:31:01 +00:00
|
|
|
}
|
2016-10-08 16:19:55 +00:00
|
|
|
|
2016-11-01 00:31:45 +00:00
|
|
|
this.children.preUpdate();
|
2016-10-08 16:19:55 +00:00
|
|
|
};
|