- Lua 97.8%
- Python 2.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
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). |
||
| .github/workflows | ||
| .zed | ||
| assets | ||
| demos | ||
| src | ||
| test | ||
| .gitignore | ||
| .luarc.json | ||
| build.py | ||
| cliff.toml | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
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
buttoncarrousel_buttoncomboboxjoysticklabellistbox- Scrolling support
- Unlimited items with no performance degradation
menu- Checkable items
numberboxscrollbarspinner- Optional negative/positive toggle
tabcontrol- Adjustable magnitude circle
textboxtoggle_buttontrackbar
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:
- Python >= 3.9 (official download site)
- git bash (as included in Git for Windows)
Build steps:
- 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
- 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.
- Install dependencies:
pip install -r requirements.txt
- 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.