dat.gui/demo.html

40 lines
788 B
HTML
Raw Normal View History

2011-01-23 21:23:53 +00:00
<html>
<head>
<script type="text/javascript" src="gui.js"></script>
<script type="text/javascript">
var controllableObject =
{
"numberProperty": 20,
"anotherNumberProperty": 0,
"textProperty": "a string",
2011-01-23 21:39:07 +00:00
"booleanProperty": false,
"functionProperty": function() {
alert("hi");
},
2011-01-23 21:47:42 +00:00
"objectProp": {}
2011-01-23 21:23:53 +00:00
};
2011-01-23 21:39:07 +00:00
// Creates a number box
GUI.add(controllableObject, "numberProperty");
// Creates a slider (min, max)
GUI.add(controllableObject, "anotherNumberProperty", -100, 100);
// Creates a text field
GUI.add(controllableObject, "textProperty");
// Creates a checkbox
GUI.add(controllableObject, "booleanProperty");
// Creates a button
GUI.add(controllableObject, "functionProperty");
2011-01-23 21:47:42 +00:00
GUI.add(controllableObject, "objectProp");
2011-01-23 21:23:53 +00:00
</script>
</head>
<body>
</body>
</html>