Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by RomainT

Hi,

I created a custom debug panel but I would like to open it as the game load. How to do that?

I tried many things : trigger a click with jQuery on the tab, call the toggle method on the panel object and so on. Since I make many little adjustments, I can't just click each time.

Thanks! :)

1 decade ago by Graphikos

I was able to do it like this:

ig.debug.togglePanel({target: ig.debug.panels.panelName.menuItem}, ig.debug.panels.panelName);

Where panelName is the name you specify when adding the panel.

1 decade ago by RomainT

Thanks to Graphikos solution, I wrote this little helper function.

window.displayDebugPanel = function(panelName) {
  ig.debug.togglePanel({
    target: ig.debug.panels[panelName].menuItem
  }, ig.debug.panels[panelName]);
};

I think that this should be in the core Debug class since it is quite handy. So Dominic if you hear me… ;)
Page 1 of 1
« first « previous next › last »