Metadata-Version: 2.4
Name: passer-2d
Version: 0.9.1
Summary: Flash-style 2D display list for Python, in the spirit of Sparrow/Starling: scene graph, mesh batching, custom shader styles, stencil masks, filters and distance-field text on moderngl + pyglet
Author: Davide "Tanner" Taini
License: Simplified BSD License
        ======================
        
        Passer — a Python port of the Sparrow Framework.
        
        Copyright 2026 Davide "Tanner" Taini (Python port)
        Copyright 2011-2015 Gamua (original Sparrow Framework, Objective-C)
        
        Redistribution and use in source and binary forms, with or without modification,
        are permitted provided that the following conditions are met:
        
           1. Redistributions of source code must retain the above copyright notice, this list of
              conditions and the following disclaimer.
        
           2. Redistributions in binary form must reproduce the above copyright notice, this list
              of conditions and the following disclaimer in the documentation and/or other materials
              provided with the distribution.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
        EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
        OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
        SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
        INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
        TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
        BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
        CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
        ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
        DAMAGE.
        
Project-URL: Homepage, https://github.com/Tanner85/passer-2d
Project-URL: Source, https://github.com/Tanner85/passer-2d
Project-URL: Changelog, https://github.com/Tanner85/passer-2d/blob/main/CHANGES-0.9.0.md
Keywords: 2d,game,engine,gamedev,starling,sparrow,display-list,scene-graph,moderngl,pyglet,distance-field,sdf
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: moderngl>=5.10
Requires-Dist: pyglet>=2.0
Dynamic: license-file

# Passer

**A Python 2D game framework in the spirit of
[Sparrow](https://gamua.com/sparrow/) and
[Starling](https://gamua.com/starling/)** — the Flash-style display list,
reborn on [moderngl](https://github.com/moderngl/moderngl) (rendering) and
[pyglet](https://pyglet.org) (window, input, audio).

The sparrow (genus *Passer*) flies again — this time in Python.

*Leggi il [README in italiano](README.it.md).*

```python
from passer import App, Quad

app = App(400, 300, "Hello Passer")
quad = app.stage.add_child(Quad(100, 100, color=0xFF3355))
quad.align_pivot()
quad.x, quad.y = 200, 150

app.run(lambda dt: setattr(quad, "rotation", quad.rotation + dt))
```

## Why

Sparrow brought Flash's *display list* to iOS, and Starling carried it to
a whole generation of 2D games: a scene graph with hierarchical
transforms, tweens, jugglers and texture atlases — an ergonomics the
Python 2D ecosystem (flat sprite lists) never had. Passer brings that
architecture to Python, with a batching renderer on modern OpenGL that
can be tested **headless, down to the pixel**.

## Features

- **Scene graph** — `Sprite`, `Quad`, `Image`, `Mesh`, hierarchical
  transforms (pivot, scale, rotation, skew), bubbling events, touch and
  keyboard input, hit testing that follows actual geometry
- **Starling 2 rendering core** — CPU-transformed mesh batching
  (`MeshBatch`/`BatchProcessor`): one draw call per state run
- **Mesh styles** — plug your own GLSL shader into any mesh *without
  breaking batching* (`MeshStyle`/`MeshEffect`)
- **Distance field text & shapes** — crisp at any scale, with outline,
  glow and drop shadow in a single pass; built-in SDF generator
  (exact euclidean distance transform, pure Python)
- **Masks** — stencil-based, rotated and nested, inverted masks included
- **Blend modes** — add, multiply, screen, erase, mask, below + custom
- **Canvas & Polygon** — filled polygons (ear-clipping triangulation),
  circles, rounded rectangles, quadratic/cubic Bézier paths
- **Filters** — blur, color matrix, drop shadow, glow, and `FilterChain`
  to compose them; pooled render targets
- **RenderTexture** — draw once, render forever (trails, painting,
  destructible terrain)
- **Animation** — `Juggler`, `Tween` (with transitions), `MovieClip`,
  delayed calls
- **Text** — AngelCode bitmap fonts, embedded 8px "mini" font (plus its
  distance-field twin, generated at runtime)
- **AssetManager** — enqueue folders, load with progress, fetch
  everything by name; atlas regions found automatically
- **Desktop citizenship** — letterbox scaling (fit/integer/stretch),
  fullscreen, mouse wheel, hover

## Install

```
pip install passer-2d
```

Requires Python ≥ 3.10 and OpenGL 3.3. Linux, Windows and macOS
(everything pyglet + moderngl support).

## Tested where it counts

The whole rendering pipeline is exercised by **134 tests** that render
on a headless standalone GL context and assert on real pixels — masks,
blend modes, filters, distance fields, triangulation. No window needed;
they run in CI.

## Demos

The [`demos/`](demos/) folder is a tour: a mini platformer with the
original Sparrow assets, vector night scenes, playing cards drawn with
Bézier curves, plasma shaders, stencil-mask lanterns, drop shadows,
SDF typography, and the three-line AssetManager pantry.

## Heritage & license

Passer is a conceptual port of the Sparrow Framework and of Starling 2
(© Gamua GmbH, Simplified BSD) — same architecture, pythonic API
(`snake_case`, properties, duck typing). Passer itself is released
under the Simplified BSD license; see [LICENSE.md](LICENSE.md).

A heads-up for contributors: the codebase is documented **in Italian**
(docstrings and comments) — the author's native tongue. The API itself
is plain English.
