Flexible immediate-mode Lua GUI library
  • Lua 97.8%
  • Python 2.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Frame 8daab81a6b
feat(combobox): keyboard support for editable and configurable signal and selected index change behavior (#80)
This changes the `signal_change` behavior of comboboxes as follows:
- While the listbox is open, the value is `ongoing` if the selected
original index is different from `control.selected_index`, or `none`
otherwise.
- When the listbox was just closed and the selected original index is
different from `control.selected_index`, the value is `ended`
- The value is virtually never `started`. Should maybe be changed.

This enables users of the `ugui.combobox` API to react to the `ended`
signal_change, fixing usability issues that would arise from prematurely
updating the value fed into `control.selected_index`.

Additionally, the up and down arrow keys may be used to move the
selected index, and enter may be used to confirm the selection (i.e.
close the listbox).
2026-06-28 02:46:27 +02:00
.github/workflows ci: add stable release creation workflow (#78) 2026-04-26 19:05:07 +02:00
.zed build: add zed build watch task (#82) 2026-05-06 23:01:35 +02:00
assets build!: add amalgamation system (#44) 2026-02-28 10:34:49 +01:00
demos feat(combobox): keyboard support for editable and configurable signal and selected index change behavior (#80) 2026-06-28 02:46:27 +02:00
src feat(combobox): keyboard support for editable and configurable signal and selected index change behavior (#80) 2026-06-28 02:46:27 +02:00
test chore: rename remaining references to "mupen-lua-ugui" and modernize readme (#53) 2026-03-02 08:24:25 +01:00
.gitignore build!: add amalgamation system (#44) 2026-02-28 10:34:49 +01:00
.luarc.json chore: put LuaLS config in .luarc.json (#49) 2026-02-28 16:22:30 +01:00
build.py refactor: move types into relevant places (#62) 2026-03-15 15:06:35 +01:00
cliff.toml chore: update cliff.toml (#58) 2026-03-09 22:41:33 +01:00
LICENSE Initial commit 2023-05-29 18:17:20 +02:00
README.md chore: update readme (#64) 2026-03-19 09:16:04 +01:00
requirements.txt build!: add amalgamation system (#44) 2026-02-28 10:34:49 +01:00

ugui

Flexible immediate-mode GUI library for Lua

🚀 Quickstart

Download breitbandgraphics-amalgamated.lua and ugui-amalgamated.lua from the latest release and place them anywhere in your project.

Then call dofile for them with their absolute paths:


-- Get the directory where your entry script file is located (Windows, includes trailing backslash)
folder = debug.getinfo(1).source:sub(2):match('(.*\\)')

---@module "breitbandgraphics-amalgamated"
BreitbandGraphics = dofile(folder .. 'breitbandgraphics-amalgamated.lua')

---@module "ugui-amalgamated"
ugui = dofile(folder .. 'ugui-amalgamated.lua')

That's it.
Read the demo scripts for usage examples.

Features

Control Suite

  • button
  • carrousel_button
  • combobox
  • joystick
  • label
  • listbox
    • Scrolling support
    • Unlimited items with no performance degradation
  • menu
    • Checkable items
  • numberbox
  • scrollbar
  • spinner
    • Optional negative/positive toggle
  • tabcontrol
    • Adjustable magnitude circle
  • textbox
  • toggle_button
  • trackbar

Rendering

Can render using a built-in Windows 10-like style, or with ninesliced images.

Depends on BreitbandGraphics for rendering, which is included in this repository as well (see below).

Hackability

Any part of the library can be overwritten externally. Future compatibility not guaranteed.

🛠️ Building from source

The breitbandgraphics-amalgamated.lua and ugui-amalgamated.lua files are both built via the build.py python script.

Requirements:

Build steps:

  1. Open a git bash, then clone the repository and navigate into the repository via the following command:
git clone https://github.com/mupen64/ugui.git && cd ./ugui
  1. Create a python virtual environment and activate it:
python -m venv ./.venv
source ./.venv/Scripts/activate

Note: The second line must be executed in each new terminal session in order to build.

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the build script:
python build.py

That's it.
breitbandgraphics-amalgamated.lua and ugui-amalgamated.lua should now have been created in the ./build/ directory.


BreitbandGraphics

The rendering abstraction

Backends

Built-in backend for the Mupen64 emulator.

Utilities

Provides various utilities for color conversion and manipulation.