A GUI builder for pygame (using pygame_gui).
Project description
PgStudio 0.5.0
🚧 Notice: Beta Software
PgStudio is in early beta and still under active development. Please expect bugs and incomplete features. We welcome your feedback—submit bug reports and feature requests via our Discord server: Taireru LLC ™ // PgStudio // #bugs-and-stuff.
Note: PgStudio is not affiliated with
pygame,pygame_gui, or PostgreSQL. Despite the name, PgStudio is a standalone GUI editor built to assist with development ofpygameapplications usingpygame_gui.
PgStudio is a drag-and-drop GUI editor for pygame, powered by pygame_gui.
🔄 What’s New in 0.5.0
- Error Dialogs: Clear
UIMessageWindowpop-ups appear when operations like save/export/draw fail. - Theming Support: PgStudio will automatically apply styles from
themes/pgstudio_theme.jsonif it exists. - Undo/Redo: All object edits (add, delete, rename, property changes) are tracked with full undo/redo support.
- Custom Button Events: You can now assign scripts to Button
on_clickevents using your/scripts/folder.
📜 License Agreement
Upon launching PgStudio, a Software User Agreement will appear. You must accept the agreement to use the software.
Key terms:
- You must agree to the terms before use.
- Do not copy, modify, redistribute, or create derivatives of PgStudio.
- Viewing source code is allowed for learning, not modification.
- Content you create is yours; PgStudio itself remains proprietary.
- Declining or closing the prompt will attempt to uninstall the software.
- Usage is governed under the laws of Arkansas, USA.
If you do not agree, you may not use PgStudio.
📦 Installation
pip install pgstudio
🚀 Quickstart
import pgstudio
pgstudio.configure(core="path/to/my_project_folder")
pgstudio.launch()
This creates:
my_project_folder/objects.jsonmy_project_folder/scripts/my_project_folder/images/- (optional)
my_project_folder/themes/pgstudio_theme.json— for custom theming
🧭 UI Overview
1. Toolbar (Top)
- Undo/Redo: Revert or reapply recent changes
- Save: Manually save
objects.json - Export: Generate
main.pywith event bindings - New Project: Clears all objects/scripts/images (with confirmation)
2. Explorer (Left)
- Hierarchical tree of all objects
- Right-click blank → add root object
- Right-click object → add child / rename / delete
- Arrow icon ▶/▼ toggles expansion
3. Canvas (Center)
- Drag objects with real-time layout updates
- Resize using bottom-right corner
- Draw order determined by
z_order - Yellow outline highlights selected objects
4. Properties (Right)
-
Editable fields:
- abs_x, abs_y, w, h, visible, z_order, name
-
Type-specific options:
- Rectangle: color
- Button: text, font size, color,
on_clickscript - Label: text, font size, color
- Image: file picker
- TextInput: placeholder, text color, background
- Script: “Edit Script” button
-
Delete object button at bottom
5. Error Handling
- All errors (I/O, invalid inputs, etc.) open a
UIMessageWindowwith details.
6. Theming
- Load
themes/pgstudio_theme.jsonif present. - Customizable UI: buttons, panels, fonts, etc.
↩️ Undo/Redo Details
-
Every mutation (add/delete/rename/update) snapshots the full
nodesstructure. -
Undo: reverts to last snapshot.
-
Redo: reapplies previously undone snapshot.
-
Supported operations:
add_objectdelete_objectrename_objectupdate_propertiesmove_node
⚡ Custom Button Events
- Only Buttons currently support event bindings.
- In Properties panel, select an
on_clickscript from/scripts/. - On export,
main.pyis generated with proper event wiring:
import scripts.MyScript as script_<button_id>
...
if e.type == pygame_gui.UI_BUTTON_PRESSED and e.ui_element == elements['<button_id>']:
script_<button_id>.run(elements['<button_id>'], event=e)
In scripts/MyScript.py:
def run(obj, event=None):
# Do something with the clicked button
🎨 Theming
- The default theme file is
themes/pgstudio_theme.json - Customize fonts, button colors, panel styles, and more.
- If missing or renamed, PgStudio falls back to default
pygame_guitheme.
❗ Error Dialogs
- Any failure—drawing, file I/O, invalid user actions—triggers a
UIMessageWindowwith a descriptive message.
🧪 Local Development
-
Open terminal and run:
pip install pgstudio
-
Open your IDE.
-
Create and run this test script:
import pgstudio pgstudio.configure("my_test_project") pgstudio.launch()
Enjoy building UIs without writing boilerplate—just drag, drop, click, and export! Happy coding! 🚀🎨
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pgstudio-0.5.0.tar.gz.
File metadata
- Download URL: pgstudio-0.5.0.tar.gz
- Upload date:
- Size: 44.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87ffbc3f1777e98560bef62cded3671a65c9c1ce9c262c6e8dacd3af91ecb8a2
|
|
| MD5 |
8b51b907ca965340e2ae6e31559915d9
|
|
| BLAKE2b-256 |
d22e30aacd652e481f72ac11cf485e99e878d81f24e9cb3b819c9ed7a79fed54
|
File details
Details for the file pgstudio-0.5.0-py3-none-any.whl.
File metadata
- Download URL: pgstudio-0.5.0-py3-none-any.whl
- Upload date:
- Size: 51.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee8cc459fabd8f6434d9e278827a67f2b6c19cfe85247d7f2cef5f0a8cf5a3a5
|
|
| MD5 |
12b1e359412ae89e3e1fdb968d275b49
|
|
| BLAKE2b-256 |
1937259d87b2938eb552484efe60d73df1c3e89cb9b109ed264b5b2f0329f8da
|