> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/gum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/gum/code/getting-started/setup/empty-project-before-adding-gum/pygame.md).

# Pygame

## Experimental Note

{% hint style="danger" %}
***WARNING:*** This project is an experiment and proof of concept. The goal was to see if PythonNET could be used to export the C# GUM UI backend Layout Engine to be used in other tools like Python with PyGame.

Currently it "works" but there are many missing features and bugs.

Right now it only draws a RECTANGLE that encompasses the entire size of the GUM UI's [GraphicalUiElement](/gum/code/gum-code-reference/graphicaluielement.md).

You can then add other objects to this root object (that are currently only drawing rectangles).

You can't control the color, it starts at color value RGB(20, 20, 20) and increases in color intensity by 20 and wraps around at 256.

If this ends up being something that others want, please join the [discord](https://discord.gg/EvqwmSQuBz) or put tickets into [github](https://github.com/vchelaru/Gum).
{% endhint %}

Gum can be used in Pygame. To begin, create an empty Pygame project. For more information see <https://www.pygame.org/wiki/GettingStarted>

Next, you can begin adding Gum to your project. For more information see the [Adding/Initializing Gum](/gum/code/getting-started/setup/adding-initializing-gum/pygame.md) page.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flatredball.com/gum/code/getting-started/setup/empty-project-before-adding-gum/pygame.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
