Update readme

This commit is contained in:
Matthias Richter 2013-01-23 13:18:32 +01:00
parent 90eb0a9184
commit f799f48164

View file

@ -30,14 +30,14 @@ Quickie is an [immediate mode gui][IMGUI] library for [LÖVE][LOVE]. Initial
foo = false, foo = false,
demo = false demo = false
} }
local check1 = {checked = false, label = "Checkbox"} local check1 = false
local check2 = {checked = false, label = "Another one"} local check2 = false
local input = {text = ""} local input = {text = ""}
local slider = {value = .5} local slider = {value = .5}
local slider2d = {value = {.5,.5}} local slider2d = {value = {.5,.5}}
function love.update(dt) function love.update(dt)
gui.group.push{grow = "down", pos = {5,5}} 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 menu_open.main = not menu_open.main
end end
@ -70,47 +70,53 @@ Quickie is an [immediate mode gui][IMGUI] library for [LÖVE][LOVE]. Initial
gui.group.pop{} gui.group.pop{}
if menu_open.demo then if menu_open.demo then
gui.group.push{grow = "down", pos = {200, 80}} gui.group{grow = "down", pos = {200, 80}, function()
love.graphics.setFont(fonts[20]) love.graphics.setFont(fonts[20])
gui.Label{text = "Widgets"} gui.Label{text = "Widgets"}
love.graphics.setFont(fonts[12]) love.graphics.setFont(fonts[12])
gui.group.push{grow = "right"} gui.group.push{grow = "right", function()
gui.Button{text = "Button"} gui.Button{text = "Button"}
gui.Button{text = "Tight Button", size = {"tight"}} gui.Button{text = "Tight Button", size = {"tight"}}
gui.Button{text = "Tight² Button", size = {"tight", "tight"}} gui.Button{text = "Tight² Button", size = {"tight", "tight"}}
gui.group.pop{} end}
gui.group.push{grow = "right"} gui.group.push{grow = "right", function()
gui.Button{text = "", size = {2}} gui.Button{text = "", size = {2}} -- acts as separator
gui.Label{text = "Tight Label", size = {"tight"}} gui.Label{text = "Tight Label", size = {"tight"}}
gui.Button{text = "", size = {2}} gui.Button{text = "", size = {2}}
gui.Label{text = "Center Label", align = "center"} gui.Label{text = "Center Label", align = "center"}
gui.Button{text = "", size = {2}} gui.Button{text = "", size = {2}}
gui.Label{text = "Another Label"} gui.Label{text = "Another Label"}
gui.Button{text = "", size = {2}} gui.Button{text = "", size = {2}}
gui.group.pop{} end}
gui.group.push{grow = "right"} gui.group.push{grow = "right"}
gui.Checkbox{info = check1, size = {"tight"}} if gui.Checkbox{checkbox = check1, text = "Checkbox", size = {"tight"}} then
gui.Checkbox{info = check2} 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.pop{}
gui.group.push{grow = "right"} gui.group.push{grow = "right", function()
gui.Label{text = "Input", size = {70}} gui.Label{text = "Input", size = {70}}
gui.Input{info = input, size = {300}} gui.Input{info = input, size = {300}}
gui.group.pop{} end}
gui.group.push{grow = "right"} gui.group.push{grow = "right", function()
gui.Label{text = "Slider", size = {70}} gui.Label{text = "Slider", size = {70}}
gui.Slider{info = slider} gui.Slider{info = slider}
gui.Label{text = ("Value: %.2f"):format(slider.value), size = {70}} gui.Label{text = ("Value: %.2f"):format(slider.value), size = {70}}
gui.group.pop{} end}
gui.Label{text = "2D Slider", pos = {nil,10}} gui.Label{text = "2D Slider", pos = {nil,10}}
gui.Slider2D{info = slider2d, size = {250, 250}} gui.Slider2D{info = slider2d, size = {250, 250}}
gui.Label{text = ("Value: %.2f, %.2f"):format(slider2d.value[1], slider2d.value[2])} gui.Label{text = ("Value: %.2f, %.2f"):format(slider2d.value[1], slider2d.value[2])}
end}
end end
end end