voxel-debug
Debug helpers for voxel.js using dat-gui.
example
// Loads a dat-gui in the top right with settingsvar debug = game // Add a x,y,z axis at center of game and 10 voxels bigdebugaxis0 0 0 10
You may want to add to your own settings to the dat-gui controls. Install dat-gui with npm install dat-gui
and configure as such:
var gui = new var debug = game: game gui: gui // Create a folder and add position properties for a fictious itemvar folder = guifolderfolderfolder // OR just let this lib create a dat-gui instance for youvar debug = gamevar folder = debuggui
Please goto http://workshop.chromeexperiments.com/examples/gui/ for more examples on using dat-gui.
Please open a PR to add more useful default debug properties!
api
var createDebug = require('voxel-debug')
Returns a function to create a debugger:
var debug =
debug.axis([position, size])
Displays a new axis at position
and with size
. Returns the AxisHelper
.
debug.open()
Opens all the folders.
debug.close()
Closes all the folders.
debug.gui
Contains the active instance of dat-gui.
debug.folder
Contains the active instance of the debug
folder that contains
install
With npm do:
npm install voxel-debug
Use browserify to require('voxel-debug')
.
release history
- 0.3.0 - Add render properties (@deathcap)
- 0.2.0 - Add open/close methods
- 0.1.0 - initial release
license
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.