This example demonstrates a shared drawing canvas where multiple users can draw simultaneously. It features smooth Catmull-Rom curves, color picking, adjustable brush thickness, and efficient incremental rendering.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Walkercito/repod/llms.txt
Use this file to discover all available pages before exploring further.
What This Example Demonstrates
- Real-time collaborative drawing with multiple clients
- Pygame integration with repod’s network loop
- Smooth curve rendering using Catmull-Rom splines
- Efficient incremental canvas updates (tail rendering)
- Storing and replaying drawing history for new connections
- Managing per-player state on the server
Complete Code
How to Run
New clients automatically receive all existing drawing history when they connect, so they see everything that’s been drawn so far.
Key Takeaways
- Pygame integration: The
pump()call fits naturally into a pygame event loop running at 60 FPS - Incremental rendering: Drawing only the “tail” of strokes prevents expensive full-canvas redraws on every point
- Smooth curves: Catmull-Rom splines convert jagged mouse input into smooth, professional-looking curves
- State persistence: The server stores all drawing history per-player and sends it to newly connecting clients
- Per-channel data: Each
WhiteboardChanneltracks its own drawing history with a unique ID - Efficient relay pattern: The
_relay()method tags data with the sender’s ID before broadcasting