aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMatthias Richter <vrld@vrld.org>2012-02-07 23:10:29 +0100
committerMatthias Richter <vrld@vrld.org>2012-02-07 23:10:29 +0100
commit40dbc7134bae5cff48c2262d92721a3dd5394f84 (patch)
treede6097abf421b873aa6052928c56fbd578bafa01 /README.md
downloadQuickie-40dbc7134bae5cff48c2262d92721a3dd5394f84.tar.gz
Quickie-40dbc7134bae5cff48c2262d92721a3dd5394f84.tar.bz2
Quickie-40dbc7134bae5cff48c2262d92721a3dd5394f84.tar.xz
Quickie-40dbc7134bae5cff48c2262d92721a3dd5394f84.zip
Initial commit
Diffstat (limited to 'README.md')
-rw-r--r--README.md47
1 files changed, 47 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5aed0ff
--- /dev/null
+++ b/README.md
@@ -0,0 +1,47 @@
+# QUICKIE
+
+Quickie is an [immediate mode gui][IMGUI] library for LÖVE.
+
+## Example
+
+ local gui = require 'quickie'
+
+ -- widgets are "created" by calling their corresponding functions in love.update.
+ -- if you want to remove a widget, simply don't call the function (just like with
+ -- any other love drawable). widgets dont hold their own state - this is your job:
+ --
+ -- sliders have a value and optional a minimum (default = 0) and maximum (default = 1)
+ local slider = {value = 10, min = 0, max = 100}
+ -- input boxes have a text and a cursor position (defaults to end of string)
+ local input = {text = "Hello, World!", cursor = 0}
+ -- checkboxes have only a `checked' status
+ local checkbox = {checked = false}
+
+ function love.update(dt)
+ -- widgets are defined by simply calling them. usually a widget returns true if
+ -- if its value changed or if it was activated (click on button, ...)
+ if gui.Input(input, 10, 10, 300, 20) then
+ print('Text changed:', input.text)
+ end
+
+ if gui.Button('Clear', 320,10,100,20) then
+ input.text = ""
+ end
+
+ -- add more widgets here
+ end
+
+ function love.draw()
+ -- draw the widgets which were "created" in love.update
+ gui.core.draw()
+ end
+
+ function love.keypressed(key,code)
+ -- forward keyboard events to the gui. If you don't want widget tabbing and
+ -- input widgets, skip this line
+ gui.core.keyboard.pressed(key, code)
+ end
+
+## Documentation
+
+TODO