mirror of
https://github.com/wassname/phaser.git
synced 2026-08-14 12:40:17 +08:00
Promoted the Tilemap to a DisplayObject and vastly simplified the load process.
This commit is contained in:
+2
-1
@@ -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
@@ -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;
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user