A simple UI library written in Lua for the LÖVE2D framework

Docs pages-build-deployment

Disclaimer

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.

Give it a taste

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

simple

Feature list

  • Basic elements are :
    - ImageButton
    - Rectangle
    - Layout
    - Stack
    - Image
    - Label
    
  • Declarative approach. Similar to QML.
  • Grid layout. Nested layouts are possible.
  • Auto alignment. Alignment hints : center, top, bottom, left or 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

Dependencies

Installation

luarocks install likelihud

Examples

Run main.lua :

love path/to/likelihud

and press 1, 2, 3 to switch between examples. See the code here.

Demo

This is a demo (code here):

demo

Signals

This is the simplest game ever written with LÖVE2D (code here):

signals example

Documentation

Documentation is available here.

Acknowledgements and similar projects

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.

generated by LDoc 1.5.0 Last updated 2025-11-16 10:17:18