Giter VIP home page Giter VIP logo

voxel-debug's Introduction

voxel-debug

Debug helpers for voxel.js using dat-gui.

example

View this example

// Loads a dat-gui in the top right with settings
var debug = require('voxel-debug')(game)

// Add a x,y,z axis at center of game and 10 voxels big
debug.axis([0, 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 (require('dat-gui')).GUI()
var debug = require('voxel-debug')({
  game: game,
  gui: gui
})

// Create a folder and add position properties for a fictious item
var folder = gui.addFolder('Item Position')
folder.add(item.position, 'x')
folder.add(item.position, 'y')
folder.add(item.position, 'z')

// OR just let this lib create a dat-gui instance for you
var debug = require('voxel-debug')(game)
var folder = debug.gui.addFolder('My Own Thing')

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 = createDebug({game: game, gui: gui})

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.

voxel-debug's People

Contributors

deathcap avatar shama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.