mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Starting navigation
This commit is contained in:
parent
634ddc0736
commit
121da420e8
@ -158,6 +158,11 @@ GUI.Scrubber = function(controller, timer) {
|
||||
_this.timer.hoverPoint = cur;
|
||||
}
|
||||
}
|
||||
if (_this.timer.hoverPoint == null) {
|
||||
document.body.style.cursor = "pointer";
|
||||
} else {
|
||||
document.body.style.cursor = "auto";
|
||||
}
|
||||
_this.render();
|
||||
});
|
||||
|
||||
|
@ -25,6 +25,7 @@ GUI.Slider = function(numberController, min, max, step, initValue) {
|
||||
var onDrag = function(e) {
|
||||
if (!clicked) return;
|
||||
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);
|
||||
val = Math.round(val/step)*step;
|
||||
numberController.setValue(val);
|
||||
|
16
index.html
16
index.html
@ -44,25 +44,23 @@
|
||||
|
||||
// Text field
|
||||
gui.add(fizzyText, "message")
|
||||
.at(-1000, "gui-dat")
|
||||
.at(1000, "is")
|
||||
.at(2000, "the")
|
||||
.at(3000, "shit");
|
||||
.at(2000, "getting")
|
||||
.at(3000, "pretty")
|
||||
.at(4000, "tight");
|
||||
|
||||
// Sliders with min and max
|
||||
gui.add(fizzyText, "maxSize", 0.5, 7);
|
||||
gui.add(fizzyText, "growthSpeed", 0.01, 1);
|
||||
|
||||
gui.add(fizzyText, "speed", 0.1, 2);
|
||||
|
||||
// Sliders with min, max and increment.
|
||||
gui.add(fizzyText, "noiseStrength", 10, 100, 5).
|
||||
at(1000, 30).
|
||||
at(4500, 20).
|
||||
at(7000, 100);
|
||||
gui.add(fizzyText, "noiseStrength", 10, 100, 5);
|
||||
|
||||
// Boolean checkbox
|
||||
gui.add(fizzyText, "displayOutline")
|
||||
.at(250, true)
|
||||
.at(450, false);
|
||||
gui.add(fizzyText, "displayOutline");
|
||||
|
||||
// Fires a function called "explode"
|
||||
gui.add(fizzyText, "explode")
|
||||
|
Loading…
Reference in New Issue
Block a user