Promoted the Tilemap to a DisplayObject and vastly simplified the load process.

This commit is contained in:
Richard Davey
2013-09-12 04:24:01 +01:00
parent 3d22d0e169
commit dbaf7269e9
10 changed files with 541 additions and 397 deletions
+2 -1
View File
@@ -351,7 +351,8 @@ Phaser.Game.prototype = {
}
else
{
// They must have requested WebGL and their browser supports it
// They requested WebGL, and their browser supports it
this.renderType = Phaser.WEBGL;
this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.stage.canvas, this.transparent, this.antialias);
this.canvas = this.renderer.view;
this.context = null;
+20 -3
View File
@@ -52,7 +52,12 @@ Phaser.Group.prototype = {
if (child.group !== this)
{
child.group = this;
child.events.onAddedToGroup.dispatch(child, this);
if (child.events)
{
child.events.onAddedToGroup.dispatch(child, this);
}
this._container.addChild(child);
}
@@ -65,7 +70,12 @@ Phaser.Group.prototype = {
if (child.group !== this)
{
child.group = this;
child.events.onAddedToGroup.dispatch(child, this);
if (child.events)
{
child.events.onAddedToGroup.dispatch(child, this);
}
this._container.addChildAt(child, index);
}
@@ -82,9 +92,16 @@ Phaser.Group.prototype = {
create: function (x, y, key, frame) {
var child = new Phaser.Sprite(this.game, x, y, key, frame);
child.group = this;
child.events.onAddedToGroup.dispatch(child, this);
if (child.events)
{
child.events.onAddedToGroup.dispatch(child, this);
}
this._container.addChild(child);
return child;
},