Add fields for params in __init__ in UiText

This commit is contained in:
Michał Czekański 2020-04-05 22:15:23 +02:00
parent d6945f2bed
commit 9ddcec6d73

View File

@ -7,10 +7,14 @@ from src.ui.UiElement import UiElement
class UiText(UiElement):
def __init__(self, rect: pygame.Rect, text: str, font: pygame.font.Font = None,
textColor: Tuple[int, int, int] = (0, 0, 0), antialias: bool = False,
backgroundColor: Tuple[int, int, int] = None):
textColor=(0, 0, 0), antialias: bool = False,
backgroundColor=None):
super().__init__(rect)
self.backgroundColor = backgroundColor
self.antialias = antialias
self.textColor = textColor
self.text = text
if font is None:
font = pygame.font.Font(None, 12)
self.font = font