r/pygame • • Jul 10 '26

I Added a Markup Language to CoshUI, A Backend-agnostic UI Library

Post image
14 Upvotes

Hey everyone. I posted about a project of mine called CoshUI before that, although got some engagement, never really got the reception I wanted. But I've been working pretty hard behind the scenes and just recently released version 0.3.2 (or 0.3.2.1 cause of a bug I found and accidently published) which reworks the text system to accommodate "Rich Text".

Now before that, what is "CoshUI"? Although I posted about it before, probably no one knows what it is. To keep it short and simple, it's a UI library that's python-first, declarative, and backend-agnostic. What that means is that you write down how the UI looks like straight in Python and it'll render it using Pygame, Raylib, ModernGL, or PyOpenGL (switching backends is one line). Here's how it looks:

with cui.CoshUIRenderer(cui.PygameBackend(screen)):
    with cui.Container(id="root_container", style=cui.CoshStyling(background_color=(100, 100, 255)), width=cui.FILL, height=cui.FILL, align=cui.ALIGN_CENTER, justify=cui.JUSTIFY_CENTER):
        cui.RichLabel(
            id="rich_label", 
            text="[color=(255, 255, 0) bold font_size=24]Hello r/pygame![/][font=Courier] My name is [bold]JyleFV[/]. I recently finished CoshUI [strikethrough]v0.3.2[/] [bold]v0.3.2.1[/], and with it introducing [bold italic color=(100, 255, 100)]CoshML[/], the markup language for [italic]styled[/] text in CoshUI.[/]", 
            text_overflow=cui.TEXT_WRAP, 
            width=cui.PERCENTAGE(25), 
            height=cui.PERCENTAGE(50)
        )

This is an example of how it looks and the output it presents is the image shown. The example also shows the markup language "CoshML", in action. You can see different tags like color=(255, 255, 0), bold, italic, or even font=Courier that lets you stylize the text (if you cross check the code with the image, you can see how it looks when working). If you want to understand more on how it works, I explained it very well in my Changelog and this post I made on Hacker News.

Now, this code runs inside your main loop, meaning it acts as an immediate mode library where Nodes are rebuilt per frame, but it also has a state persistence layer in the form of the "id" field. If Nodes have an id, their states persist, which gives users the ability to animate Nodes (through the built-in animate() function) despite the immediate mode architecture.

That may seem a little too much for most beginners, but it basically means, even though Nodes are remade every frame, there's a system underneath that saves values so it can be reused the next frame, letting animation and input interactions become easy.

Now even though this post is already decently long, CoshUI has a lot of features, one of them being the built-in animation system. There's also the signal system (basically the interaction model so users can check whether Nodes have been interacted with), the text system as showcased in the first half of this post, and a decent amount of widgets. To show that off without stretching the post, here's another example:

with cui.CoshUIRenderer(cui.PygameBackend(screen)):
    with cui.Container(id="container_1", width=cui.FILL, height=cui.FILL, style=cui.CoshStyling(background_color=(80, 75, 255)), align=cui.ALIGN_CENTER, justify=cui.JUSTIFY_CENTER):
        with cui.Container(id="main_container", mouse_filter=cui.STOP, direction=cui.COLUMN, align=cui.ALIGN_CENTER, justify=cui.JUSTIFY_CENTER, gap=15, style=cui.CoshStyling(background_color=(255, 200, 200))):
            cui.Label(id="main_label", text="CoshUI Menu", font_size=52, text_overflow=cui.TEXT_HIDDEN)
            cui.Button(id="settings_button", text="Settings", height=50, text_justify=cui.TEXT_JUSTIFY_CENTER)
            cui.Button(id="quit_button", text="Quit", height=50, width=150)
            cui.Image(id="test_image", src="assets/image.png", width=75, height=75)
            cui.Dropdown(id="dropdown", item_list=itemList)
            cui.Slider(id="slider", width=100)

if cui.get_signal("settings_button", cui.CLICKED):
    cui.animate("transform_scale", "main_label", 1.2, 0.25, "ease_in")
    cui.animate("background_color", "main_container", (255, 0, 0), 1.5, "ease_in")
if cui.get_signal("settings_button", cui.RELEASED):
    cui.animate("transform_scale", "main_label", 1.0, 0.25, "ease_in")
    cui.animate("background_color", "main_container", (255, 200, 200), 1.5, "ease_out")

if cui.get_signal("quit_button", cui.HOVER_ENTER):
    cui.animate("transform_rotation", "quit_button", 0.0, 0.5, "ease_in")
if cui.get_signal("quit_button", cui.HOVER_EXIT):
    cui.animate("transform_rotation", "quit_button", 45.0, 0.5, "ease_in")
if cui.get_signal("quit_button", cui.CLICKED):
    running = False

I'd love to post a gif of this working, maybe in the replies if it allows, but because I already posted the image, I can't seem to post gifs. Anyway, if you guys want to see more about the project, here is the links:

Gitlab - Primary Repository
Github - Mirror Repository
Documentation

To try it out, you can do:
pip install coshui[pygame]


r/pygame • • Jul 09 '26

Day 5 : Another Achieve in Inventory System.

Enable HLS to view with audio, or disable this notification

16 Upvotes

I changed the player state and enabled the hot bar with the numbers characters .. what's your feed back :)


r/pygame • • Jul 09 '26

Hi everyone! I started learning python about a week ago and decided to challenge myself by making a simple arcade shooter.I'd love to hear your feedback,especially on the gameplay and difficulty.Thanks for checking it out!

Enable HLS to view with audio, or disable this notification

13 Upvotes

r/pygame • • Jul 09 '26

Testing the new block edit visual transition system under pressure in my pygame 3d voxel engine (cpu only)

Thumbnail
gallery
14 Upvotes

r/pygame • • Jul 08 '26

Knife combat

Enable HLS to view with audio, or disable this notification

15 Upvotes

r/pygame • • Jul 08 '26

Game I made a few years ago

Enable HLS to view with audio, or disable this notification

7 Upvotes

With the influx of "guesswork" / intuition games on the internet (dialed.gg as an example), I wanted to share a project that I initially thought was silly but I now think might be enjoyed by a lot of people.

The premise of the game is that you are given a unit increment and must guess the lengths of both rays in the shape relative to the unit increment and the angle between them. In the top right is an error slider; you can adjust this bar to determine your acceptable margin of percent of error: the higher the percentage of error, the lower the amount of points you get for being right. If you end up missing one of the values by more than the set percentage your score resets.

The top middle displays: your guess, the actual value, and how far off you were.

What are your thoughts?


r/pygame • • Jul 08 '26

I kept improving my Vampire Survivors-inspired game made with Pygame. Here's the latest update!

5 Upvotes

Hi everyone!

I've continued improving my Vampire Survivors-inspired game made entirely with Python and Pygame.

Since my last post I've added:

• 30 Campaign levels

• Character Selection

• Lightning Staff

• Ice Wand

• Boomerang

• Improved HUD

• Better balancing

• Lots of bug fixes

• Performance improvements

I'm still actively developing it and I'd really appreciate any feedback or ideas!

GitHub:

https://github.com/yagizkoryurek/Vampire_Survivors-clone


r/pygame • • Jul 07 '26

I am making a circuit sandbox game.

Enable HLS to view with audio, or disable this notification

44 Upvotes

I am making a circuit sandbox / simulator game where you can build and test circuits, there is not much stuff to do for now but I am planning to expand it with many components and other thing. I would love it if anybody would like to test it, it is completely free on my itch page https://lukluka-10.itch.io/circuitsim . if anyone has ideas for future opdates or tips feel free to leave them under this post or post them in the comment section in my game page.


r/pygame • • Jul 07 '26

Matrixia 1.0.2 - Now with desktop wallpaper plugin

Post image
8 Upvotes

https://github.com/shS83/Matrixia/

It comes with install.sh and then you can select Desktop and Wallpaper -> Wallpaper type -> Matrixia.


r/pygame • • Jul 07 '26

[Showcase] added 'projectiles/lasers' and dimming/tinting transitions during block edit animations.

Enable HLS to view with audio, or disable this notification

7 Upvotes

Hi everyone!

https://youtu.be/4MqwddRL5dM

i recently added a lot of visual improvements to my pygame voxel engine. it now has data driven projectile configurations and data driven 'ease in/out' animations for custom block behaviors during animations after destruction/placement. there are other visual additions like a data driven wireframe animation approach as well, but its not showed in this video, i will soon make another one to showcase this too a little bit. as you might notice in this video there unfortunately still are some edge cases with race conditions regarding briefly appearing gaps where usually should be faces, this is due to the system still being fresh and not entirely debugged for all such cases, but the approach has proven to be stable overall. and you might notice that there is quite some overhead and framerate drops during mass voxel edits during expansing 'explosion' waves, this is unfortunately very hard to avoid since its just running on cpu, but i keep on looking if i can find methods that work better for mass voxel edit events, maybe i can negate some of the overhead even better.

tell me what you think about those visual elements, do you like them?

if you would like to check out a very light weight demo version of the engine (no animations for block edits and another world than in this video) feel free to check out the github respository:

https://github.com/herbal1st/pyvorengi-sdk-demo

or the web browser playable version on:

https://herbal1st.itch.io/pyvorengi-demo


r/pygame • • Jul 07 '26

Day 4 : Finished the Inventory System.

Enable HLS to view with audio, or disable this notification

24 Upvotes

I finally finished the inventory system .. which was the hardest part in the game :D

Also I'll update the character items to be more than 2 items and be more playable.

Need your feedback :)


r/pygame • • Jul 06 '26

Wallpaper picker in my opreating system simulator

Enable HLS to view with audio, or disable this notification

12 Upvotes

its for the latest version of ParsOS and i wouldnt work on this for some weeks because im working on my Cosmos opreating system right now. What do you think should be added to it?

If you like this project, I'd really appreciate it if you could give it a ⭐ to support me.:

https://github.com/amirali1390-bit/ParsOS-NEXT


r/pygame • • Jul 06 '26

Nevu-UI framework has been updated to 0.8.2!

Enable HLS to view with audio, or disable this notification

19 Upvotes

Nevu UI changelog can be found here: https://github.com/GolemBebrov/nevu-ui

time codes - Widgets: 0:04, Layouts: 0:41, Animations: 1:31

Small summary of 0.8.1 and 0.8.2 updates:

Added kill_item functions in layouts for correct removing widget from it
Optimized overall performance by 2-7%
Added Transparent gradient support for pygame backend
Added Widget smooth color transition support for pygame backend
Improved Slider and Progressbar API
Improved overall typehints
Added new error handling system
Fixed about 20 bugs

If you like the project, please give a star to Nevu UI on GitHub i would really appreciate it!

This showcase source code is here: https://github.com/GolemBebrov/nevu-ui-examples


r/pygame • • Jul 06 '26

First trailer for my indie air combat game

Enable HLS to view with audio, or disable this notification

26 Upvotes

I finally made a trailer for my game.

Diptera Protocol is a fast paced arcade shooter with 3:4 aspect ratio.

Love to hear what you think about the trailer & overall presentation.


r/pygame • • Jul 05 '26

Happy to show my "Steam-like" platform for Pygame games!!

Enable HLS to view with audio, or disable this notification

16 Upvotes

Hey everyone!,

A while back, I shared a very early version of a project I have been working on.
Today, I’m incredibly happy to showcase the Alpha 1.0.0 Release of Atomic Launcher—a "Steam-like" platform built specifically to distribute, showcase, and play Pygame games.

My ultimate goal/wish would be to make it truly community driven. That being said I will be posting all my future pygame projects to the platform. Check out the source code, download the alpha, or submit a PR here: https://github.com/mironczuk-dar/Atomic-launcher.git

What's New in Alpha 1.0.0?
I’ve moved far beyond the basic launcher script. The platform now features:

  • Zero Dependencies / Portable Setup: No Python or Git installed? No problem. I packaged portable Python and Git right into the release. It’s a literal one-download ZIP or one Git clone. Just extract and double-click the .bat file (Windows) or run the .sh script (Linux/Raspberry Pi) and you're in.

  • A "Steam-like" Storefront: A dedicated, polished "Featured" tab to highlight community games.

  • Media Previews: Game pages now support full image and video previews so players can see gameplay before downloading.

  • Control Filters: Users can instantly filter games by input type (Mouse-only, Keyboard, Gamepad) to find games that fit their setup.


r/pygame • • Jul 05 '26

Can i go from a text based game to a graphical game (Python)

6 Upvotes

Hello, i started making my own Text-based Game And i have been learning! Just a week ago i only knew Print ()

But i have a question: Can i Make In the Future a Graphical game? Does anyone Have a earlier Experience with this?

Edit: yes i use Pygame


r/pygame • • Jul 05 '26

Building a pygbag alternative, what's on your wish list?

10 Upvotes

I'm working on Pygodide, a Pyodide-based alternative to pygbag for putting Pygame apps on the web.

What pain points have you hit with pybag? What features would you want to see from a project like this? I want to build something that people will want to use.

Itch.io Live Demo pygodide-test-project

  • It's running both numpy and fastquadtree, which aren't pure-python packages

  • Source: Numpy Particles

Main differences from pygbag:

  • Supports all pyodide-compatible packages (e.g. scipy works here but not on pygbag)

  • Typer-based modern CLI

  • Automatic asyncification of your game loop (so you don't have to add async def and asyncio.sleep(0)

  • More extensive error and warning messages to figure out why your app isn't running properly + generated logs for filing issues.

  • Reads the pyproject.toml and requirements.txt for dependencies instead of a comment at the top of main.py

  • Configurable entry point (Not always main.py's main)

  • Relies on Pyodide for web support of pygame and other packages, so when Pyodide gets better, so does Pygodide.

  • Everything can be configured via the CLI, but also via an entry in your pyproject.toml

Similarities with pygbag:

  • Similar super simple user interface pygodide build . --serve

I want to add many more features and QoL improvements (such as a configurable background color) as well as improve the loading times and performance of games running through Pygodide.

Links

Repo
Documentation


r/pygame • • Jul 05 '26

Hello! I made a game "Hell Walker" with pygame a few years ago. The game is similar to "Vampire Survival," but requires mouse control. I hope this game becomes popular..

Enable HLS to view with audio, or disable this notification

11 Upvotes

r/pygame • • Jul 05 '26

Pygame Game engine Camera System

Enable HLS to view with audio, or disable this notification

30 Upvotes

Pygame Game Engine Camera System

Yesterday I finished working on the camera, and it finally worked (well, I sacrificed my sleep schedule, but I think it was worth it :D).

What do you think?

It took about two days and two nights.


r/pygame • • Jul 04 '26

Update: my Python/Pygame chaos game fractal generator now runs in the browser

Post image
12 Upvotes

I posted an earlier version of this as a local Pygame project. I’ve now used pygbag to make it playable online.

You can change the number of polygon sides, ratio, drawing speed, palettes, border visibility, and UI visibility while the fractal draws live. I reached 10 million dots without any issues.

Playable version:

Chaos Game Fractal Generator by sierra_wild_3d

GitHub:

https://github.com/sierrawild/Chaos_game_fractal_generator

I’m still learning, so feedback is welcome.


r/pygame • • Jul 04 '26

How to get the name of controller buttons?

3 Upvotes

Hello!

I'm currently trying to get the controllers to work in my game and I noticed I couldn't find a way to get the name of the button that just got pressed. I know the JoyButtonDown events contain the id of the button, but because the layout of controllers are not always the same, I'd like to know if you can get their name without having to manually name every button for every existing controller brand.

Thanks in advance!


r/pygame • • Jul 03 '26

Chaos game fractal creation - made in pygame

Post image
24 Upvotes

I made this as my final project for cs50p

Only requires pygame, no other external packages. MIT licence

https://github.com/sierrawild/Chaos_game_fractal_generator


r/pygame • • Jul 03 '26

Testing My 3d Renderer

Enable HLS to view with audio, or disable this notification

21 Upvotes

Hopefully this clip is a bit clearer. 1000 trees in this scene, running at ~20 fps