Skip to main content

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 of pygame applications using pygame_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 UIMessageWindow pop-ups appear when operations like save/export/draw fail.
  • Theming Support: PgStudio will automatically apply styles from themes/pgstudio_theme.json if 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_click events 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.json
  • my_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.py with 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_click script
    • 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 UIMessageWindow with details.

6. Theming

  • Load themes/pgstudio_theme.json if present.
  • Customizable UI: buttons, panels, fonts, etc.

↩️ Undo/Redo Details

  • Every mutation (add/delete/rename/update) snapshots the full nodes structure.

  • Undo: reverts to last snapshot.

  • Redo: reapplies previously undone snapshot.

  • Supported operations:

    • add_object
    • delete_object
    • rename_object
    • update_properties
    • move_node

⚡ Custom Button Events

  • Only Buttons currently support event bindings.
  • In Properties panel, select an on_click script from /scripts/.
  • On export, main.py is 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_gui theme.

❗ Error Dialogs

  • Any failure—drawing, file I/O, invalid user actions—triggers a UIMessageWindow with a descriptive message.

🧪 Local Development

  1. Open terminal and run:

    pip install pgstudio
    
  2. Open your IDE.

  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pgstudio-0.5.0.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgstudio-0.5.0-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

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

Hashes for pgstudio-0.5.0.tar.gz
Algorithm Hash digest
SHA256 87ffbc3f1777e98560bef62cded3671a65c9c1ce9c262c6e8dacd3af91ecb8a2
MD5 8b51b907ca965340e2ae6e31559915d9
BLAKE2b-256 d22e30aacd652e481f72ac11cf485e99e878d81f24e9cb3b819c9ed7a79fed54

See more details on using hashes here.

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

Hashes for pgstudio-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee8cc459fabd8f6434d9e278827a67f2b6c19cfe85247d7f2cef5f0a8cf5a3a5
MD5 12b1e359412ae89e3e1fdb968d275b49
BLAKE2b-256 1937259d87b2938eb552484efe60d73df1c3e89cb9b109ed264b5b2f0329f8da

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page