-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Description
From the SpriteBatch
docs:
new SpriteBatch(game, parent, name, addToStage)
parent - ... If undefined or null it will use game.world.
This is a simple suggestion that allows for the parent
parameter to be skipped, therefore adding the SpriteBatch
directly to game.world
.
spriteBatch: function (parent, name, addToStage) {
if (typeof parent === 'string') {
addToStage = typeof name === 'boolean' ? name : addToStage;
name = parent;
parent = undefined;
}
if (typeof name === 'undefined') { name = 'group'; }
if (typeof addToStage === 'undefined') { addToStage = false; }
return new Phaser.SpriteBatch(this.game, parent, name, addToStage);
},
e.g.,
this.game.add.spriteBatch('batch');
this.game.add.spriteBatch('batch', false);
Metadata
Metadata
Assignees
Labels
No labels