From 356a7caf5abde2b64126f53a4e489d200c0238c2 Mon Sep 17 00:00:00 2001 From: George Michael Brower Date: Mon, 18 Apr 2011 17:46:18 -0700 Subject: [PATCH] finished recreating work that git so mercilessly overwrote. --- index.html | 3 +-- src/DAT/GUI/GUI.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 68fdba9..b0b5b98 100644 --- a/index.html +++ b/index.html @@ -33,12 +33,11 @@ var fizzyText = new FizzyText("dat.gui"); var gui = new DAT.GUI(); - // Text field gui.add(fizzyText, "message"); // Sliders with min + max - gui.add(fizzyText, "maxSize").min(0.5).max(7); + gui.add(fizzyText, "maxSize"); gui.add(fizzyText, "growthSpeed").min(0.01).max(1).step(0.05); gui.add(fizzyText, "speed", 0.1, 2, 0.05); // shorthand for min/max/step diff --git a/src/DAT/GUI/GUI.js b/src/DAT/GUI/GUI.js index 617ad37..944d013 100644 --- a/src/DAT/GUI/GUI.js +++ b/src/DAT/GUI/GUI.js @@ -275,6 +275,14 @@ DAT.GUI = function(parameters) { this.add = function() { + if (arguments.length == 1) { + var toReturn = []; + for (var i in arguments[0]) { + toReturn.push(_this.add(arguments[0], i)); + } + return toReturn; + } + var object = arguments[0]; var propertyName = arguments[1]; @@ -692,6 +700,4 @@ DAT.GUI.removeClass = function(domElement, className) { if (DAT.GUI.getVarFromURL('saveString') != null) { DAT.GUI.load(DAT.GUI.getVarFromURL('saveString')); -} - -window['DAT'] = DAT; \ No newline at end of file +} \ No newline at end of file