Exposes the dat.GUI library to the Typescript API of the Superpowers Game system for Superpowers, the extensible HTML5 2D+3D game engine.
npm install superpowers-game-datgui-pluginThis plugin allows to use the dat.GUI library inside the games mades with the Superpowers Game system for Superpowers, the extensible HTML5 2D+3D game engine.
> A lightweight graphical user interface for changing variables in JavaScript.
> Get started with dat.GUI by reading the tutorial at http://workshop.chromeexperiments.com/examples/gui.
You can use dat.GUI in Superpowers exactly as in any Javascript application.
Despite having few interests for a shipped game, dat.GUI can be used as a a very fast way to create debug/placeholder menus in no time.
``typescript
var menu = {
FirstScene: function() {
Sup.loadScene(
},
OtherScene: function() {
Sup.loadScene( Sup.get("My Other Scene", Sup.Scene) );
},
doOtherGameStuff: Game.doOtherStuff
// Game.doOtherStuff() is defined somewhere else...
};
var gui = new dat.GUI();
gui.add( menu, "FirstScene" );
gui.add( menu, "OtherScene" );
gui.add( menu, "doOtherGameStuff" );
`
Note that the plugin uses a fork of dat.GUI that adds new features useful for Superpowers.
The ease of creation and use of dat.GUI's UIs also makes it a good candidate to power a UI for asset editors for instance.
http://florentpoujol.github.io/superpowers-game-datgui-plugin.
It adds a bare-bone API in addition to this readme.
You can also access the documentation offline in the plugin's public/docs folder or via the "Plugins documentation" tool provided by the Plugins documentation plugin.
Download the latest release, unzip it, rename the folder to dat-gui, move it inside app/systems/supGame/plugins/florentpoujol/ then restart your server.
__Advanced:__
Get it via npm:
cd app/systems/supGame/plugins
npm install superpowers-game-datgui-plugin
The name of the vendors or plugins in the app/systems/supGame/plugins/ folder don't matter. node_modules/superpowers-game-datgui-plugin`.
So you can leave the plugin path as