This is not intended to be a universal GUI library - the direction under this library is being developed mostly follows the requirements I have while developing my game. As a result this library might not fit your particular needs. More over, it might be changed drastically from version to version.
local ui = require('likelihud')
local simple = ui.Layout {
rows = 2,
columns = 2,
ui.Label { text = 'Hello', },
ui.Label { text = 'I', },
ui.Label { text = 'am', },
ui.Layout {
rows = 2,
columns = 2,
ui.Label { text = 'Li', },
ui.Label { text = 'ke', },
ui.Label { text = 'li', },
ui.Label { text = 'HUD', },
}
}
for block in simple:traverse() do
block.border = true
end- Basic elements are :
ImageButtonRectangleLayoutStackImageLabel
- Declarative approach. Similar to QML.
- Grid layout. Nested layouts are possible.
- Auto alignment. Alignment hints :
center,top,bottom,leftor a combination. - Each element inside a layout can be set to fill
width,height, both or none. - Communication with the external logic through the events which elements are subscribed to
luarocks install likelihudRun main.lua :
love path/to/likelihudand press 1, 2, 3, 4, 5, 6 to switch between examples. See the code here.
This is a demo (code here):
This is the simplest game ever written with LÖVE2D (code here):
Documentation is available here.
I had seen several ui libs before I decided to write my own. Though I didn't find the one which would have everything I needed I've learned a lot from them.
- More or less the list of those can be found here love2d ui libs.
- Also see yui


