From c6e66ef4093cebd5a870b3e50466f0a21d924a00 Mon Sep 17 00:00:00 2001 From: jonobr1 Date: Mon, 24 Jan 2011 23:11:24 -0800 Subject: [PATCH] updated README --- README | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/README b/README index 986c175..0f82e35 100644 --- a/README +++ b/README @@ -1,2 +1,37 @@ -GUI-DAT is a controller library for JavaScript. -Refer to https://gist.github.com/792496 for basic usage. +GUI-DAT +======= + +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"); + + } \ No newline at end of file