A lightweight GUI framework for your ZX Spectrum program. It allows you to have simple scenes with buttons, labels, edits, images and selects. It uses YAML files to specify objects on scene.
example.mov
See gui_example.tap for the recording above
- z88dk
pip3 install pyYAML Pillow
- Migrate to CMake if you haven't already
- Clone this repository as a submodule to your project in a folder e.g.
gui
- Copy/modify
example_tiles.png
into e.g.data/gui.png
- Set up your scenes (*.yaml files) in your source folder (e.g.
src
) - Make sure to call
zxgui_generate_scenes
/zxgui_generate_tiles
in your CMakeLists.txt - See CMakeLists.txt example
-
#include "zxgui.h" ... #include "scene-s.inc.h" int main() { zxgui_clear(); zxgui_scene_set(&welcome); while (1) zxgui_scene_iteration(); }
You can validate you have a correct yaml schema against gui_schema.json
It works by processing *.yaml objects with scene objects, and generating appropriate *.inc.h objects, which contain all object initialization necessary.
No code is actually executed, as initialization is completely static.
label
edit
multiline_edit
button
select
image