Skip to main content

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

pgaddons-1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgaddons-1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pgaddons-1.1.tar.gz.

File metadata

  • Download URL: pgaddons-1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for pgaddons-1.1.tar.gz
Algorithm Hash digest
SHA256 dbcb460c490df04392ea2ff10564da0fb7f8f4b90febcc15155e02d2f5441b51
MD5 50104bb6cb2511933fd3bf0afdcdca61
BLAKE2b-256 6c91ef92960e1105f4f674f1ea8797d4146fdec6ec68ae729362f5274c1120bd

See more details on using hashes here.

File details

Details for the file pgaddons-1.1-py3-none-any.whl.

File metadata

  • Download URL: pgaddons-1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for pgaddons-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e897b1b20f7efca7bba054125c1c9d384f586805fdd786979884ccff20f0811d
MD5 992b79a6b2f1ad32781ca7210f27acb0
BLAKE2b-256 c709d74c647bb5350c75c291a7ad2c0694117e8fafda75e4091e9b20f020f47a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page