Skip to main content

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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ImgGameLib-0.2.1-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file ImgGameLib-0.2.1.tar.gz.

File metadata

  • Download URL: ImgGameLib-0.2.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6

File hashes

Hashes for ImgGameLib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 677f761b994e95da5f3cd5cd337581498530f894a2091b70fca570c8120363a1
MD5 a0ffd7866c28fd2a2c30b302fe21ae3a
BLAKE2b-256 90a4fb53777f0b6f78a48f264eb8f83fe391518094214926e677c7a8b1f2a865

See more details on using hashes here.

File details

Details for the file ImgGameLib-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ImgGameLib-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6

File hashes

Hashes for ImgGameLib-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15bd089360f9e02512d06fb8d65f9104e0bbb7778c37e43624dd7d64f5eb9b37
MD5 d8c6ba3375c8728c9504c5826a22d637
BLAKE2b-256 98a82945dfa3d702ad7e6c4012fe0614f4dd88b8b1a3db39853269b124663dc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page