GithubHelp home page GithubHelp logo

aaguy-hue / imggamelib Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 157 KB

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

Home Page: https://pypi.org/project/ImgGameLib/

License: GNU General Public License v3.0

Python 100.00%
game game-engine game-2d game-engine-2d animation

imggamelib's Introduction

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.

imggamelib's People

Contributors

aaguy-hue avatar

Stargazers

 avatar

Watchers

 avatar

imggamelib's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.