mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
update build and example
example shows how UndefinedController works
This commit is contained in:
parent
3c6e2e5ea7
commit
ec87369a6e
2316
build/dat.gui.js
2316
build/dat.gui.js
File diff suppressed because one or more lines are too long
162
build/dat.gui.min.js
vendored
162
build/dat.gui.min.js
vendored
File diff suppressed because one or more lines are too long
18
example.html
18
example.html
@ -8,10 +8,24 @@
|
|||||||
<script type="text/javascript" src="build/dat.gui.min.js"></script>
|
<script type="text/javascript" src="build/dat.gui.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var obj = {
|
var obj = {
|
||||||
x: 5
|
x: undefined,
|
||||||
|
y: undefined,
|
||||||
|
timer: 2.0
|
||||||
};
|
};
|
||||||
var gui = new dat.GUI();
|
var gui = new dat.GUI();
|
||||||
gui.add(obj, 'x');
|
gui.add(obj, 'timer').min(0).max(obj.timer).listen();
|
||||||
|
gui.add(obj, 'x').listen();
|
||||||
|
var y = gui.add(obj, 'y');
|
||||||
|
var interval = setInterval(function () {
|
||||||
|
obj.timer -= 0.1;
|
||||||
|
if (obj.timer <= 0) {
|
||||||
|
clearInterval(interval);
|
||||||
|
obj.x = "Not Undefined!";
|
||||||
|
obj.y = 1;
|
||||||
|
obj.timer = 0;
|
||||||
|
y.updateDisplay();
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user