Metadata-Version: 2.4
Name: pgweb
Version: 0.9.0
Summary: pygame-ce surfaces, draw, transform, image, font, input and mixer for pyodide
License: LGPL-2.1
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: description
Dynamic: description-content-type
Dynamic: license
Dynamic: license-file
Dynamic: requires-python
Dynamic: summary

# pgweb

pygame-ce in the browser with pyodide.
Surfaces, draw, transform, image, font, freetype, mask, sprite, event, key, mouse and a WebAudio mixer.
No window and no OpenGL from pygame: you present the surfaces yourself, for example with moderngl.

## Setup

```js
const pyodide = await loadPyodide()
await pyodide.loadPackage(['pgweb-0.9.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl'])

const pgweb = pyodide.pyimport('pgweb')
eval(pgweb._extern_js)(pyodide, canvas, 320, 240)
```

Call it before `import pygame`.
The last two arguments are the size the mouse positions map to.

## Build

```sh
git submodule update --init
podman build . -o dist
```

`dist/` gets the sdist and the wasm wheel.

## License

pgweb is licensed under the LGPL-2.1, see `LICENSE`.
Copyright (c) 2026 Szabolcs Dombi for the code in this repository, the bundled projects keep their own copyright.

The wheel bundles pygame-ce (LGPL-2.1), SDL, SDL_image and SDL_ttf (zlib) and FreeType (FTL).
Their license texts are installed with the wheel in `pgweb/licenses`.

Games that load pgweb can use any license.
