dat.gui/docs/examples.js

33 lines
822 B
JavaScript
Raw Permalink Normal View History

2014-08-27 00:01:15 +00:00
var examples = {};
examples[ 'default' ] = function() {
2014-09-08 01:27:32 +00:00
2014-08-27 00:01:15 +00:00
var gui = new Gui();
2014-09-08 01:27:32 +00:00
//gui.anon( 'hi', 'todo' );
2014-08-27 00:01:15 +00:00
return gui;
}
// "basic-usage", "limiting-input", "color-controllers", "events", "folders-comments", "saving-values", "presets", "save-to-disk", "custom-placement", "defining-custom-controllers", "publishing-custom-controllers"
examples[ 'basic-usage' ] = function() {
2014-09-08 01:27:32 +00:00
2014-08-27 00:01:15 +00:00
var gui = new Gui();
var object = {
2014-09-08 01:27:32 +00:00
numberProperty: 0,
2014-08-27 00:01:15 +00:00
stringProperty: 'hey',
booleanProperty: false,
functionProperty: function() {
}
}
gui.add( object, 'numberProperty', 0, 1 ); // Slider
gui.add( object, 'stringProperty' ); // Text box
gui.add( object, 'booleanProperty' ); // Check box
gui.add( object, 'functionProperty' ); // Button
return gui;
2014-09-08 01:27:32 +00:00
};