A collection of additions to pygame.
Project description
pygame-addons
Contains classes and functions to help make games and guis with pygame
Notes
I don't know what version of python is needed for this package to work.
Anywhere in the documentation where it says pg, it is referring to pygame.
This is mainly just a passion project/project to help future projects, but it would be nice if it had some use.
Features
Here's a list of features that are currently available in this package:
Classes
Examples of how to use these classes can be found in the examples folder.
Button
A class that creates a button that can be clicked on.
Parameters:
- pos - The position of the button
- size - The size of the button
- colour - The colour of the button
- text - The text that will be displayed on the button - Default: ""
- text_colour - The colour of the text - Format: str, tuple[int, int, int] or pg.Color - Default: pg.Color("white")
- font - The font of the text - Format: str, pg.font.Font or pg.font.SysFont - Default: "freesansbold"
- font_size - The size of the font - Default: 30
Input Field
A class that creates an input field that can be typed in.
Parameters:
- pos - The position of the input field
- size - The size of the input field
- colour - The colour of the input field
- active_colour - The colour of the input field when it is active
- background_text - The text that will be displayed when the input field is empty - Format: str or list - Default: ""
- font_colour - The colour of the text - Format: str, tuple[int, int, int] or pg.Color - Default: pg.Color("white")
- font - The font of the text - Format: str, pg.font.Font or pg.font.SysFont - Default: "freesansbold"
- font_size - The size of the font - Default: 30
- max_length - The maximum length of the text in the input field - Default: 10
Slider
A class that creates a slider that can be used to go through numbers.
Parameters:
- pos - The position of the slider
- size - The size of the slider
- colour - The colour of the slider
pos, size, colour: tuple[int, int, int] | pg.Color, border_colour: tuple[int, int, int] | pg.Color, min_value: int, max_value: int, start_value: int, border_size: int = 3, background_text: str = "", font: str | type[pg.font.Font] | type[pg.font.SysFont] = "freesansbold", font_size=25, font_colour: str | tuple[int, int, int] | pg.Color = pg.Color("white"))
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pgaddons-1.2.1.tar.gz.
File metadata
- Download URL: pgaddons-1.2.1.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8e8732324e117dba0418d5fdf6aa9fbb15e6f9aad82f4aea3f6ee8b0eee2874
|
|
| MD5 |
3f1038aa15c8cd89f268aab6ea560ab2
|
|
| BLAKE2b-256 |
f1d8a0fd7c36be3c40e54da823de1126d67fa2690f2028ce56dc0cb4beacc101
|
File details
Details for the file pgaddons-1.2.1-py3-none-any.whl.
File metadata
- Download URL: pgaddons-1.2.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46b0e8d07a5540993610b2e4e10856b9cb76f542a9b863b4707082f1a04609fd
|
|
| MD5 |
5a78b4bcabbf3ea0f5579706a0dbe5e8
|
|
| BLAKE2b-256 |
1b0517cd1f499b4dd2d708a16f0f014e141dd563ed504faaf573bf03cbd60a4f
|