From 808b613273ae81ab9defea55fe12e071ed7af045 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Mon, 6 Nov 2023 19:30:30 +0100 Subject: [PATCH] Started working on update function for text buttons. --- pg.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pg.py b/pg.py index ccf7d3b..6741b4e 100644 --- a/pg.py +++ b/pg.py @@ -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