A package to add inputs that work with pygame
Project description
pygame inputs
a python library used to create input boxes and buttons in pygame for a GUI
This is a free open source python library. Please read the license before editing or sharing online
Installation:
- To use the package use the
pip install pygameinputs
command
How to use:
To get started ensure you have pygame. If you don't use: pip install pygame
to get started.
I recommend an IDE when designing an app but is not required.
button creation
Import the button scripts:
from PygameInputs.Button import Button
this line will import the button module from the Pygame Inputs library
To create a button firstly give it an identifier, in this case I am going to give mine an identifier of startGame.
The button has a blueprint and will work straight away without editing any of its attributes however it can be fully customised.
startGame = Button()
Input box creation
Import the input box scripts:
from PygameInputs.TextBox import TextBox
this line will import the textbox module form the Pygame Inputs library
To create a textbox firstly give it an identifier, in this case I am going to give mine an identifier of searchBar.
The textbox has a blueprint and will work straight away without editing any of its attributes however it can be fully customised.
searchBar = TextBox()
Label creation
Import the label scripts:
from pygameinputs.Label import Label
this line will import the label module from the Pygame Inputs library
To create a label firstly give it an identifier, in this case I am going to give mine an identifier of myLabel.
The label has a blueprint and will work straight away without editing any of its attributes however it can be fully customised.
myLabel = Label()
Slider creation
Import the slider scripts: from pygameinputs.Sliders import HorizontalSlider, VerticalSlider
this line will import the slider module from the pygame inputs library
To create a slider firstly give it an identifier. In this case I am goting to give mine and idetifier of myHorizontalSlider.
The slider has a blueprint and will work straight away without editing any of its attributes however it can be fully customised
myHorizontalSlider = HorizontalSlider()
for a vertical slider replace HorizontalSlider()
with VerticalSlider()
Changelog
Version 0.0.1
Initial release for the alpha of the library
Version 0.0.2
Updated some documentation and added extra information to PyPi.
Version 0.0.3
Fixed a bug with the border width property overwriting the background when set to 0
Version 0.0.4
- Added typing indicator
- Added built in event handling within the button and textbox
Version 0.0.5
- Added text labels
Version 0.0.6
- Added vertical and horizontal sliders
- Added hyperlink functionality within buttons to open apps and urls
Version 0.1
- Minor bug fix - centre handles on sliders
- Fixed buttons not loading ttf files
- Major bug fix - fixed flickering cursors (read documentation to ensure your cursors are fixed)
- Added image buttons
Version 0.1.1
- Added a hover state to the image buttons
- Fixed a bug with buttons still checking the hover state when not visible
Version 0.1.2
- Fixed a bug with the buttons not changing their hover state to False when hidden
Version 0.1.3
- Fixed a bug with labels not loading ttf files
- Labels can now be centred (maxwidth must be set to work)
Version 0.1.4
- Added border radius functionality to text boxes and buttons (except image buttons)
Future updates:
- Bug fixes
- Your reccomendations (read the paragraph below how to submit a feature request)
If you have any reccomendations or would like to contribute please visit the GitHub and make an issue with the enhancement label
This library is not associated with pygame, it just uses their library to add input functionality
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.
Source Distribution
Built Distribution
File details
Details for the file pygameinputs-0.1.4.tar.gz
.
File metadata
- Download URL: pygameinputs-0.1.4.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7295fd88003c7c82763c544712be811314831d9e78a94c71d893954a5b77f3bd |
|
MD5 | 0010474791d82d5e76c2af4c0bd55760 |
|
BLAKE2b-256 | a5939c017fe962811eee263b88f0dc3e819bddc01944703d96ed22442bc85cb7 |
File details
Details for the file pygameinputs-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: pygameinputs-0.1.4-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ab97ac20598a4152712728c3a206d80a30510a28e5d033768a87d8260d4a220 |
|
MD5 | 350c75d932c379ea9453b6f79254c413 |
|
BLAKE2b-256 | f42e304e40076769f679da1c5f307e6e7f147dd0975bcc7c6dbd808e782fcf80 |