A lightweight wrapper around pillow for making games with images
Project description
ImgGameLib
A light wrapper around pillow designed for the making of games through generating images.
This is useful in several scenarios in which you are very limited, such as with discord bots.
Example
# Import the module
import ImgGameLib as igl
# Create a canvas
canvas = igl.Canvas(
100,
100,
bg_color="#99CDDE",
gif=True
)
# Create a 100x100 rectangle at (50,50) and draw it
rect = igl.Rectangle(
50,
50,
100,
100
)
rect.draw(canvas)
# Move the rectangle by 5 pixels on the x axis
rect.move(x=5)
# Save the first frame to frame_1.png, and discard all animated frames
canvas.save("frame_1.png", no_gif=True)
canvas.discard()
# Move the rectangle by 10 pixels on the x axis, 10 times
for _ in range(10):
rect.move(x=10)
# Save the animation after that to animation.gif
canvas.save("animation.gif", loop=True, duration=20)
See the examples folder for more examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ImgGameLib-0.2.1.tar.gz
(7.0 kB
view hashes)
Built Distribution
ImgGameLib-0.2.1-py3-none-any.whl
(20.5 kB
view hashes)
Close
Hashes for ImgGameLib-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15bd089360f9e02512d06fb8d65f9104e0bbb7778c37e43624dd7d64f5eb9b37 |
|
MD5 | d8c6ba3375c8728c9504c5826a22d637 |
|
BLAKE2b-256 | 98a82945dfa3d702ad7e6c4012fe0614f4dd88b8b1a3db39853269b124663dc6 |