Started working on update function for text buttons.
This commit is contained in:
parent
b758d46139
commit
808b613273
1 changed files with 22 additions and 0 deletions
22
pg.py
22
pg.py
|
@ -107,6 +107,28 @@ class TextButton:
|
||||||
|
|
||||||
return pygame.Rect(self.pos, (w, h))
|
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):
|
def blit(self, surface: pygame.Surface):
|
||||||
x, y = self.pos
|
x, y = self.pos
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue