Fix font assignment in UiButton and UiText init()

This commit is contained in:
Michał Czekański 2020-04-04 19:24:47 +02:00
parent 3ff1b1b7bc
commit 41b7cd2a3f
2 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,8 @@ class UiButton(UiElement):
"""
super().__init__(rect)
if font is None:
self.font = pygame.font.Font(None, 25)
font = pygame.font.Font(None, 25)
self.font = font
self.textColor = textColor
self.clickedBtnColor = clickedBtnColor
self.notClickedBtnColor = notClickedBtnColor

View File

@ -13,5 +13,6 @@ class UiText(UiElement):
if font is None:
font = pygame.font.Font(None, 12)
self.font = font
self.image = font.render(text, antialias, textColor, backgroundColor)