An engine for pygame
Project description
Phoenyx - Pygame Engine
Some simple classes in python
that could make your life much simplier.
What it does
This library allows you to create graphical components in pygame
in a very few lines of code. It handles all color management, stroke weights and filling for you. It also provides a Vector class suitable for physics engines and mathematical drawings.
Please go and check pygame for their amazing work !
How to ?
Please refer to test.py on GitHub for a very simple but effective test file.
from phoenyx import Engine
renderer = Engine(600, 600)
def setup():
renderer.create_slider(100, 100, "slider", 0, 10, 1, 1, length=300)
renderer.create_button(300, 300, "button", action=lambda: print("button pressed"))
renderer.text_size = 15
def draw():
renderer.background(51)
renderer.text(100, 500, f"value of slider : {renderer.get_slider_value('slider')}")
if __name__ == "__main__":
renderer.run(draw, setup=setup)
For further help please try help(phenyx)
or read in-code docs.
Requirements
Obviously some distribution of python : python 3.8
and above is needed.
You will also need pygame
in order to use the Engine and numpy
to use Vectors.
Licenses
Phenyx is licensed under the GPLv3. See LICENSE for more details. Phenyx also includes the following components from other open source projects (see LICENSES folder for more):
- numpy licensed under the BSD 3-Clause "New" or "Revised" License
- pygame licended under the GNU LGPL version 2.1
Changelog
- v0.0.a1 : Initial commit and packaging
- v0.0.a2 : Some refractor
- v0.0.a3 : Wait... Buttons ?
- v0.0.a4 : Sliders now ?
- v0.1.0 : Buttons and Sliders do not rely anyore on images
TODOs
- option to hide Buttons and Sliders or to draw them only when needed
- option of alts drawing methods for Buttons
- keyboard integration
- scrollbars and side menus
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.