https://github.com/scriptlinestudios/pygame_gifs
simple library for recording gifs in pygame
https://github.com/scriptlinestudios/pygame_gifs
Last synced: 9 months ago
JSON representation
simple library for recording gifs in pygame
- Host: GitHub
- URL: https://github.com/scriptlinestudios/pygame_gifs
- Owner: ScriptLineStudios
- License: mit
- Created: 2025-03-22T19:05:20.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-03-23T11:24:04.000Z (9 months ago)
- Last Synced: 2025-03-23T11:33:07.627Z (9 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pygame_gifs
simple library for recording gifs in pygame
## install
```bash
pip install pygame_gifs
```
## example
```python
import pygame
import pygame_gifs
width = 600
height = 600
display = pygame.display.set_mode((width, height))
gf = pygame_gifs.GifRecorder("output2.gif", width, height, threads=8)
gf.start_recording()
clock = pygame.time.Clock()
x = 0
while True:
display.fill((0, 0, 0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
gf.stop_recording()
raise SystemExit
x += 1
pygame.draw.rect(display, "red", (x, 40, 32, 32))
gf.upload_frame(display)
pygame.display.set_caption(f"{clock.get_fps()}")
pygame.display.update()
clock.tick(60)
```