Docs
Before You Continue
Please note this project is still under heavy development, which means it will probably change a lot. However, all of the versions will be available to install on PyPI.
This project is stable on Debian Linux, Raspberry Pi, and Mac. When installing a previous version from PyPI, consider yourself warned, not all versions are stable, some will not even work. For example: Avoid 2.4.2.3.
Want to be a tester? take a look at this!
About
Abinde is an open-source wrapper around pygame.
Install
To install Abinde, you can open your shell and run:
pip install Abinde
or
pip3 install Abinde
Make sure you have python and pip installed!
Import
To import Abinde, open your IDE for python and add:
import Abinde as ab
Making a Game
To make the game object, you can add:
game_name = ab.Game(str(title), list(size), color(color), str(warn), str(log))
game_name.mainloop()
Run help(ab.Game)
for more technical information.
Sprites
Rectangle
To create a simple rectange/square, you can add:
rectangle_name = ab.sprite.Rectangle(list(position), list(size), color(color), str(title))
Run help(ab.sprite.Rectangle)
for more technical information.
Line
To create a line, you can add:
line_name = ab.sprite.Line(list(pos), list(size), color(color), str(title))
Run help(ab.sprite.Line)
for more technical information.
Ellipse
To create an ellipse/circle, you can add:
ellipse_name = ab.sprite.Ellipse(list(pos), list(size), color(color), str(title))
Run help(ab.sprite.Ellipse)
for more technical information.
Text
To create text, you can add:
text_name = ab.sprite.Text(str(fontname), str(text), int(fontsize), tuple(pos), color(color))
Run help(ab.sprite.Text)
for more technical information.
Image
To create an image, add:
image = ab.sprite.Image(image(image), list(pos), str(title))
Run help(ab.sprite.Image)
for more technical information.
Loading an Image
If the image is a spritesheet:
See spritesheets section.
If the image is not a spritesheet:
img = ab.LoadImage(str(path))
You can also use:
pygame.image.load(str(path))
But LoadImage()
uses the PIL
module, so it is more reliable.
Events
On Mouse Down
Trigger event on mouse down:
OnMouseDown(game(game), def(do))
On Mouse Up
Trigger event on mouse up:
OnMouseUp(game(game), def(do))
On Mouse Motion
Trigger event on mouse motion:
OnMouseMotion(game(game), def(do))
On Update
Trigger event on update:
OnUpdate(game(game), def(do))
Audio
To play audio:
audio_name = Audio(str(file), int(volume))
audio_name.play()
audio_name.pause()
audio_name.unpause()
Spritesheets
To load a spritesheet:
sheet = ab.spritesheet(str(filename))
To return an image from sheet:
sheet.image_at(tuple(rectangle), color(colorkey))
Colors
Run help(ab.color)
for more info.
Keys
Run help(ab.keys)
for more info.
Mods
Run help(ab.mods)
for more info.
More
- This project could be better! Join the Abinde Team to help!
- If you make a game with this module, tag it
abinde
and i’ll give it a look!