mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
updated README
This commit is contained in:
parent
f814a59131
commit
c6e66ef409
39
README
39
README
@ -1,2 +1,37 @@
|
|||||||
GUI-DAT is a controller library for JavaScript.
|
GUI-DAT
|
||||||
Refer to https://gist.github.com/792496 for basic usage.
|
=======
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
------
|
||||||
|
|
||||||
|
var controllableObject =
|
||||||
|
{
|
||||||
|
numberProperty: 20,
|
||||||
|
anotherNumberProperty: 0,
|
||||||
|
textProperty: "a string",
|
||||||
|
booleanProperty: false,
|
||||||
|
functionProperty: function() {
|
||||||
|
alert("I am a function!");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
|
||||||
|
GUI.start();
|
||||||
|
|
||||||
|
// 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");
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user