Started working on update function for text buttons.

This commit is contained in:
The Wobbler 2023-11-06 19:30:30 +01:00
parent b758d46139
commit 808b613273

22
pg.py
View file

@ -107,6 +107,28 @@ class TextButton:
return pygame.Rect(self.pos, (w, h))
# def update(self, new_text: str=None, new_pos: tuple = None, new_func=None, new_key: int=None, new_text_color: tuple=None, new_bg_color: tuple=None, new_font: pygame.font.Font=None): # coming soon
# if new_text is None:
# new_text = self.text
#
# if new_pos is None:
# new_pos = self.pos
#
# if new_func is None:
# new_func = self.function
#
# if new_key is None:
# new_key = self.button.key
#
# if new_text_color is None:
# new_text_color = self.text_color
#
# if new_bg_color is None:
# bg_color = self.bg_color
#
# if new_font is None:
# new_font = self.font
def blit(self, surface: pygame.Surface):
x, y = self.pos