Metadata-Version: 2.4
Name: webpygame
Version: 1.0.0
Summary: Stream Pygame windows directly to an HTML browser viewport.
Author: Brodie
License-Expression: MIT
Keywords: pygame,website,browser,websocket
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pygame>=2.0.0
Requires-Dist: websockets>=14.0
Dynamic: license-file

# webpy

Make a website with plain pygame. `webpy` streams your pygame window to any browser tab.

```
pip install webpygame
```

```python
import webpy

screen = webpy.display.set_mode((800, 500))
clicks = 0
button = webpy.Rect(300, 220, 200, 60)

while True:
    for event in webpy.event.get():
        if event.type == webpy.MOUSEBUTTONDOWN and button.collidepoint(event.pos):
            clicks += 1
    screen.fill((30, 34, 48))
    webpy.draw.rect(screen, (90, 94, 235), button, border_radius=12)
    webpy.display.flip()      # sends the frame to the browser
```

Run it, and your browser opens. Every browser tab gets its own copy of your site.

* `webpy.display.url()`: the address for other computers on your network
* `webpy.display.public()`: a public link that works from anywhere (uses Cloudflare's free `cloudflared`)
* `webpy.display.set_url("/about")`: change the address bar
* `webpy.settings`: change defaults (`public`, `share`, `separate_tabs`, `max_tabs`, `fps`, ...)

Everything from pygame is available as `webpy.something` too.
