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
Close
Hashes for pygame-truly-centered-button-0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1c6c3ecf5786cb1ceff2fbcb23a1660c41b955e1ed4733180179597408c7cf4 |
|
MD5 | 807e57f7c249f7f1de6aae8dffddcfdc |
|
BLAKE2b-256 | c42cd341fae283d9cca7a38e51e3341dbaeee55e37655eb646a08972545a3144 |