Skip to content

A wrapper around pillow designed for the making of games through generating images.

License

Notifications You must be signed in to change notification settings

aaguy-hue/ImgGameLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A wrapper around pillow designed for the making of games through generating images.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages