Starting navigation

This commit is contained in:
George Michael Brower 2011-02-02 19:45:12 -05:00
parent 634ddc0736
commit 121da420e8
3 changed files with 14 additions and 10 deletions

View File

@ -158,6 +158,11 @@ GUI.Scrubber = function(controller, timer) {
_this.timer.hoverPoint = cur; _this.timer.hoverPoint = cur;
} }
} }
if (_this.timer.hoverPoint == null) {
document.body.style.cursor = "pointer";
} else {
document.body.style.cursor = "auto";
}
_this.render(); _this.render();
}); });

View File

@ -25,6 +25,7 @@ GUI.Slider = function(numberController, min, max, step, initValue) {
var onDrag = function(e) { var onDrag = function(e) {
if (!clicked) return; if (!clicked) return;
var pos = GUI.getOffset(_this.domElement); var pos = GUI.getOffset(_this.domElement);
console.log(pos.left + " " + pos.top);
var val = GUI.map(e.pageX, pos.left, pos.top + _this.domElement.offsetWidth, min, max); var val = GUI.map(e.pageX, pos.left, pos.top + _this.domElement.offsetWidth, min, max);
val = Math.round(val/step)*step; val = Math.round(val/step)*step;
numberController.setValue(val); numberController.setValue(val);

View File

@ -44,25 +44,23 @@
// Text field // Text field
gui.add(fizzyText, "message") gui.add(fizzyText, "message")
.at(-1000, "gui-dat")
.at(1000, "is") .at(1000, "is")
.at(2000, "the") .at(2000, "getting")
.at(3000, "shit"); .at(3000, "pretty")
.at(4000, "tight");
// Sliders with min and max // Sliders with min and max
gui.add(fizzyText, "maxSize", 0.5, 7); gui.add(fizzyText, "maxSize", 0.5, 7);
gui.add(fizzyText, "growthSpeed", 0.01, 1); gui.add(fizzyText, "growthSpeed", 0.01, 1);
gui.add(fizzyText, "speed", 0.1, 2); gui.add(fizzyText, "speed", 0.1, 2);
// Sliders with min, max and increment. // Sliders with min, max and increment.
gui.add(fizzyText, "noiseStrength", 10, 100, 5). gui.add(fizzyText, "noiseStrength", 10, 100, 5);
at(1000, 30).
at(4500, 20).
at(7000, 100);
// Boolean checkbox // Boolean checkbox
gui.add(fizzyText, "displayOutline") gui.add(fizzyText, "displayOutline");
.at(250, true)
.at(450, false);
// Fires a function called "explode" // Fires a function called "explode"
gui.add(fizzyText, "explode") gui.add(fizzyText, "explode")