mirror of
https://github.com/wassname/phaser-plugin-isometric.git
synced 2026-09-09 11:28:50 +08:00
Decoupled References to Enable Typescript
Added a Reference to Projector to Phaser.Plugin.Isometric. Added a delegate addIsoSprite() to Phaser.Plugin.Isometric.
This commit is contained in:
Vendored
+10
-2
@@ -45,9 +45,9 @@
|
||||
Phaser.Plugin.Isometric = function (game, parent) {
|
||||
|
||||
Phaser.Plugin.call(this, game, parent);
|
||||
|
||||
this.projector = new Phaser.Plugin.Isometric.Projector(this.game, Phaser.Plugin.Isometric.CLASSIC);
|
||||
// Add an instance of Isometric.Projector to game.iso if it doesn't exist already
|
||||
this.game.iso = this.game.iso || new Phaser.Plugin.Isometric.Projector(this.game, Phaser.Plugin.Isometric.CLASSIC);
|
||||
this.game.iso = this.game.iso || this.projector;
|
||||
};
|
||||
|
||||
Phaser.Plugin.Isometric.prototype = Object.create(Phaser.Plugin.prototype);
|
||||
@@ -965,6 +965,14 @@ Phaser.GameObjectFactory.prototype.isoSprite = function (x, y, z, key, frame, gr
|
||||
|
||||
};
|
||||
|
||||
Phaser.Plugin.Isometric.prototype.addIsoSprite = function (x, y, z, key, frame, group) {
|
||||
console.log("game", this.game);
|
||||
console.log("factory", this.game.add);
|
||||
return Phaser.GameObjectFactory.prototype.isoSprite.call(this.game.add, x, y, z, key, frame, group);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Phaser.Utils.Debug.prototype.isoSprite = function (sprite, color, filled) {
|
||||
|
||||
if (!sprite.isoBounds) {
|
||||
|
||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
@@ -264,6 +264,12 @@ Phaser.GameObjectFactory.prototype.isoSprite = function (x, y, z, key, frame, gr
|
||||
|
||||
};
|
||||
|
||||
Phaser.Plugin.Isometric.prototype.addIsoSprite = function (x, y, z, key, frame, group) {
|
||||
return Phaser.GameObjectFactory.prototype.isoSprite.call(this.game.add, x, y, z, key, frame, group);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Phaser.Utils.Debug.prototype.isoSprite = function (sprite, color, filled) {
|
||||
|
||||
if (!sprite.isoBounds) {
|
||||
|
||||
+2
-2
@@ -45,9 +45,9 @@
|
||||
Phaser.Plugin.Isometric = function (game, parent) {
|
||||
|
||||
Phaser.Plugin.call(this, game, parent);
|
||||
|
||||
this.projector = new Phaser.Plugin.Isometric.Projector(this.game, Phaser.Plugin.Isometric.CLASSIC);
|
||||
// Add an instance of Isometric.Projector to game.iso if it doesn't exist already
|
||||
this.game.iso = this.game.iso || new Phaser.Plugin.Isometric.Projector(this.game, Phaser.Plugin.Isometric.CLASSIC);
|
||||
this.game.iso = this.game.iso || this.projector;
|
||||
};
|
||||
|
||||
Phaser.Plugin.Isometric.prototype = Object.create(Phaser.Plugin.prototype);
|
||||
|
||||
Reference in New Issue
Block a user