Metadata-Version: 2.4
Name: tessella
Version: 0.1.2
Summary: A declarative framework for creating UIs in Pygame-CE.
Project-URL: Homepage, https://github.com/cuaitz/tessella
Project-URL: Repository, https://github.com/cuaitz/tessella
Project-URL: Documentation, https://tessella.readthedocs.io/
Project-URL: Issues, https://github.com/cuaitz/tessella/issues
Author: cuaitz
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: pygame
Requires-Python: <3.15,>=3.12
Requires-Dist: numpy>=2.4.6
Requires-Dist: pygame-ce>=2.5.7
Requires-Dist: pyperclip>=1.11.0
Description-Content-Type: text/markdown

# Tessella

Tessella is a declarative, Flutter-inspired widget framework for building
user interfaces on top of [pygame-ce](https://pyga.me/): HUDs, menus,
inventories, dialogue boxes, dashboards, or entire tools, built out of
composable widgets instead of hand-rolled `blit` calls.

<p align="center">
  <img src="https://raw.githubusercontent.com/cuaitz/tessella/main/docs/source/_static/images/examples/hud_overlay.png" alt="An in-game HUD overlay built with Tessella" width="45%">
  <img src="https://raw.githubusercontent.com/cuaitz/tessella/main/docs/source/_static/images/examples/skill_tree.png" alt="A skill tree built with Tessella" width="45%">
</p>

## Features

- **Declarative widget tree**: compose UIs out of `Row`, `Column`, `Stack`,
  `Container`, `Padding`, and friends, the same way you would in Flutter.
- **Reactive state**: `ValueNotifier` and `Listener` widgets update the
  screen automatically when the state behind them changes, no manual
  redraw bookkeeping.
- **Rich widget set**: buttons, checkboxes, switches, radios, sliders,
  text fields, dropdowns, scrollables, overlays, and more, all themeable
  through dedicated style objects.
- **Decoupled styling**: structure and style are separate, so the same
  widget tree can be reskinned completely by swapping style objects alone.
- **Drop-in with pygame**: Tessella doesn't own the window or the game
  loop, it's a layer you call into from a regular `pygame` application.

See the [gallery](https://tessella.readthedocs.io/en/latest/gallery.html)
for a full visual tour of complete screens and every individual widget.

## Installation

Tessella targets **Python 3.12 to 3.14** and depends on `pygame-ce`, `numpy`,
and `pyperclip`.

```bash
pip install tessella
```

## Quickstart

```python
import pygame
from tessella import *

pygame.init()

display = pygame.display.set_mode((400, 300), pygame.RESIZABLE)
clock = pygame.time.Clock()

gui: Widget = Center(
    Text(
        "Hello, Tessella!",
        style=TextStyle(font_size=32, font_color="#222222")
    )
)
gui.calculate_layout(display.get_rect())

running = True
while running:
    delta_time = clock.tick(60)

    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        elif event.type == pygame.WINDOWRESIZED:
            gui.calculate_layout(display.get_rect())

        gui.process_event(event)

    gui.update(delta_time)

    display.fill("#ffffff")
    gui.render(display)
    pygame.display.update()

pygame.quit()
```

Every Tessella app follows the same loop: `calculate_layout` once (and on
resize), then `process_event` / `update` / `render` once per frame.

## Documentation

Full docs (installation, a step-by-step tutorial, core concepts, the
widget-by-widget guide, and the API reference) are at
[tessella.readthedocs.io](https://tessella.readthedocs.io/).

To build them locally:

```bash
pip install -r docs/requirements.txt
cd docs
make html   # On Windows: make.bat html
```

## License

Tessella is licensed under the [MIT License](LICENSE).
