From 40dbc7134bae5cff48c2262d92721a3dd5394f84 Mon Sep 17 00:00:00 2001 From: Matthias Richter Date: Tue, 7 Feb 2012 23:10:29 +0100 Subject: Initial commit --- README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 README.md (limited to 'README.md') 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 -- cgit v1.2.3-54-g00ecf