Jump to content

Phaser Sprite GUI (with dat.gui)


samme
 Share

Recommended Posts

Hi Samme, I was thinking your spriteGUI would be useful if there was a method of changing the sprite whose properties were being displayed, maybe explicitly bing told which sprite to change to or even offering this ability itself, eg by passing in an array of sprites.

From my previous dealings with dat.gui I'm pretty sure it gets tricky trying to remove/reuse components, but I've a helper function somewhere that might be useful if you wanted to try this.

Link to comment
Share on other sites

Hi stupot, that would be neat but I'm not ready to dig into the dat.gui parts just yet. You might add sprites like this (not tested):

game.world.onChildInputDown.add(function(sprite) {
  if (!sprite.data.gui) {
    sprite.data.gui = new SpriteGUI(sprite);
    sprite.onDestroy.add(function() {
      sprite.data.gui.destroy();
      sprite.data.gui = null;
    });
  }
});

 

Link to comment
Share on other sites

  • 5 months later...
  • 6 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...