A Pygame button library that fixes text-centering
Project description
TRULY CENTERED BUTTON CLASS
Sick and tired of Pygame's uncentered text on your buttons? Look no further!
my_button = Button(params)
Required parameters
- screen:
pygame.Surface
- text:
str
- COLOR:
tuple
(r, g, b)
- center:
tuple
(x, y)
- dim:
tuple
(w, h)
Optional parameters
- thickness:
int
(default = 1)
- radius:
int
(default = -1)
- font_size:
int
(default = w*0.9)
Additional Attributes
- real_rect: Actual surrounding border seen on screen
- font_rect: Invisible border that wraps the text
- screen_color: Screen color behind the button
Methods
- is_hovered(): Checks if button is hovered (does not update visual state)
- check_clicked(): Updates visual state of button based on user mouse event
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
Close
Hashes for pygame-truly-centered-button-0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd2296a1c9df969df09caf6e666ad93519db2672d7289c970ec7b6e48a1dbd92 |
|
MD5 | 2f64b8b82f1953837d24e8ee8664946b |
|
BLAKE2b-256 | 90895461bdfe255f35086fc667fc1d9bc22d8d98c3e7cb9049d9c9bf68b5fa11 |
Close
Hashes for pygame_truly_centered_button-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df529f4e73e90dcc1ec50df13a161645cd8877e8fc31e9e94e4cdfec453dd3e4 |
|
MD5 | 2fc6a0020c1dd7499777c87cdb643319 |
|
BLAKE2b-256 | 97e164b6eb555f33a2afb8817cde838991c8584e053358854def82db9e3e4a77 |