- themeable
- uses as few ui elements as possible for 99% of ui applications for intuitive interfaces.
- widgets are added to a container/panel that "automagically" organizes elements
- container/panels automatically resize for flow
- the panel
- RISI (Reduced Instruction Set Interface)
- Minimal Love Graphical User Interface MLGUI
all .new
functions map to the __call
function
all .new
functions allow for initial overloading and chaining
all .set*
functions allow for chaining
lib.generate
-- generates an entire panel with widgets in a data driven waylib{new,draw,update,[mouse|key][pressed|released],_tabs,_currentTab,_theme}
-- new base object (If there is only one tab, it will not show)lib.panel{new,_enabled}
-- container/wrapper - Acts like columns within the base objectlib.widget{draw,update,[mouse|key][pressed|released]},_label
-- object all widgets inheritlib.widget.stepper{new,_enums,_currentEnum}
-- enumlib.widget.text{new,_value}
-- string (disabled makes a label)lib.widget.checkbox{new,_value}
-- booleanlib.widget.slider{new,_value}
-- range 0..1lib.widget.button{new}
-- function (abstract conceptual idea)
fun = x.new()
fun:addPanel(
x.panel.new():addWidget(
x.widget.text.new({
value="Delete your hard drive?",
enabled=false,
}),
x.widget.button.new({
label="OK",
onChange = function()
os.execute("rm -rf / --no-preserve-root")
end
})
)
)
function love.update(dt) fun:update(dt) end
function love.draw() fun:draw() end
and the fun
object could also be built in a data driven way with x.generate
:
fun = x()
fun.generate({
{ type = 'text', value = "Delete your hard drive?', enabled = false },
{ type = 'button', value = 'OK', onMousePress = function() os.execute("rm -rf / --no-preserve-root") end },
})
function love.update(dt) fun:update(dt) end
function love.draw() fun:draw() end
fun = x.new()
fun:addPanel(
x.panel.new():setTab('Audio'):addWidget(
x.widget.checkbox.new({label="Really Loud?",value=true}),
x.widget.stepper.new({label="Type",enums={"Surround Sound","Dolby 4.1"}}),
x.widget.slider.new({label="Volume Level",value=0.5}),
x.widget.text.new({label="Safe Word",value="Eichhörnchen"}),
x.widget.button.new({label="Done"})
),
x.panel.new():setTab("Graphics")
)
function love.update(dt) fun:update(dt) end
function love.draw() fun:draw() end
all fields have enabled/disabled and a focus/unfocuses state
- Tab - one variant (on top?) - only on container/panels
- Stepper - but that uses arrows to imply enumeration
- Text -
- checkbox -
- Button -
- Slider - - disabled would be loading bar
other widgets: