aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Richter <vrld@vrld.org>2013-01-23 13:18:32 +0100
committerMatthias Richter <vrld@vrld.org>2013-01-23 13:18:32 +0100
commitf799f48164775ce79a09fc5edf2f22e4b324c57c (patch)
treec9f798309650b01d04c75095d9e3b3c60c9af6c2
parent90eb0a91846a51787ff616fc174e809851077c6f (diff)
downloadQuickie-f799f48164775ce79a09fc5edf2f22e4b324c57c.tar.gz
Quickie-f799f48164775ce79a09fc5edf2f22e4b324c57c.tar.bz2
Quickie-f799f48164775ce79a09fc5edf2f22e4b324c57c.tar.xz
Quickie-f799f48164775ce79a09fc5edf2f22e4b324c57c.zip
Update readme
-rw-r--r--README.md92
1 files changed, 49 insertions, 43 deletions
diff --git a/README.md b/README.md
index c484eeb..bd34479 100644
--- a/README.md
+++ b/README.md
@@ -30,14 +30,14 @@ Quickie is an [immediate mode gui][IMGUI] library for [L&Ouml;VE][LOVE]. Initial
foo = false,
demo = false
}
- local check1 = {checked = false, label = "Checkbox"}
- local check2 = {checked = false, label = "Another one"}
+ local check1 = false
+ local check2 = false
local input = {text = ""}
local slider = {value = .5}
local slider2d = {value = {.5,.5}}
function love.update(dt)
gui.group.push{grow = "down", pos = {5,5}}
- if gui.Button{text = "Menu"} then
+ if gui.Checkbox{checked = menu_open.main, text = "Show Menu"} then
menu_open.main = not menu_open.main
end
@@ -70,47 +70,53 @@ Quickie is an [immediate mode gui][IMGUI] library for [L&Ouml;VE][LOVE]. Initial
gui.group.pop{}
if menu_open.demo then
- gui.group.push{grow = "down", pos = {200, 80}}
-
- love.graphics.setFont(fonts[20])
- gui.Label{text = "Widgets"}
- love.graphics.setFont(fonts[12])
- gui.group.push{grow = "right"}
- gui.Button{text = "Button"}
- gui.Button{text = "Tight Button", size = {"tight"}}
- gui.Button{text = "Tight² Button", size = {"tight", "tight"}}
- gui.group.pop{}
-
- gui.group.push{grow = "right"}
- gui.Button{text = "", size = {2}}
- gui.Label{text = "Tight Label", size = {"tight"}}
- gui.Button{text = "", size = {2}}
- gui.Label{text = "Center Label", align = "center"}
- gui.Button{text = "", size = {2}}
- gui.Label{text = "Another Label"}
- gui.Button{text = "", size = {2}}
- gui.group.pop{}
-
- gui.group.push{grow = "right"}
- gui.Checkbox{info = check1, size = {"tight"}}
- gui.Checkbox{info = check2}
- gui.group.pop{}
-
- gui.group.push{grow = "right"}
- gui.Label{text = "Input", size = {70}}
- gui.Input{info = input, size = {300}}
- gui.group.pop{}
-
- gui.group.push{grow = "right"}
- gui.Label{text = "Slider", size = {70}}
- gui.Slider{info = slider}
- gui.Label{text = ("Value: %.2f"):format(slider.value), size = {70}}
- gui.group.pop{}
-
- gui.Label{text = "2D Slider", pos = {nil,10}}
- gui.Slider2D{info = slider2d, size = {250, 250}}
- gui.Label{text = ("Value: %.2f, %.2f"):format(slider2d.value[1], slider2d.value[2])}
+ gui.group{grow = "down", pos = {200, 80}, function()
+
+ love.graphics.setFont(fonts[20])
+ gui.Label{text = "Widgets"}
+ love.graphics.setFont(fonts[12])
+ gui.group.push{grow = "right", function()
+ gui.Button{text = "Button"}
+ gui.Button{text = "Tight Button", size = {"tight"}}
+ gui.Button{text = "Tight² Button", size = {"tight", "tight"}}
+ end}
+
+ gui.group.push{grow = "right", function()
+ gui.Button{text = "", size = {2}} -- acts as separator
+ gui.Label{text = "Tight Label", size = {"tight"}}
+ gui.Button{text = "", size = {2}}
+ gui.Label{text = "Center Label", align = "center"}
+ gui.Button{text = "", size = {2}}
+ gui.Label{text = "Another Label"}
+ gui.Button{text = "", size = {2}}
+ end}
+
+ gui.group.push{grow = "right"}
+ if gui.Checkbox{checkbox = check1, text = "Checkbox", size = {"tight"}} then
+ check1 = not check1
+ if gui.Checkbox{checkbox = check2, text = "Another Checkbox"} then
+ check2 = not check2
+ end
+ if gui.Checkbox{checkbox = check2, text = "Linked Checkbox"} then
+ check2 = not check2
+ end
+ gui.group.pop{}
+ gui.group.push{grow = "right", function()
+ gui.Label{text = "Input", size = {70}}
+ gui.Input{info = input, size = {300}}
+ end}
+
+ gui.group.push{grow = "right", function()
+ gui.Label{text = "Slider", size = {70}}
+ gui.Slider{info = slider}
+ gui.Label{text = ("Value: %.2f"):format(slider.value), size = {70}}
+ end}
+
+ gui.Label{text = "2D Slider", pos = {nil,10}}
+ gui.Slider2D{info = slider2d, size = {250, 250}}
+ gui.Label{text = ("Value: %.2f, %.2f"):format(slider2d.value[1], slider2d.value[2])}
+ end}
end
end