Fix font assignment in UiButton and UiText init()
This commit is contained in:
parent
3ff1b1b7bc
commit
41b7cd2a3f
@ -13,7 +13,8 @@ class UiButton(UiElement):
|
|||||||
"""
|
"""
|
||||||
super().__init__(rect)
|
super().__init__(rect)
|
||||||
if font is None:
|
if font is None:
|
||||||
self.font = pygame.font.Font(None, 25)
|
font = pygame.font.Font(None, 25)
|
||||||
|
self.font = font
|
||||||
self.textColor = textColor
|
self.textColor = textColor
|
||||||
self.clickedBtnColor = clickedBtnColor
|
self.clickedBtnColor = clickedBtnColor
|
||||||
self.notClickedBtnColor = notClickedBtnColor
|
self.notClickedBtnColor = notClickedBtnColor
|
||||||
|
@ -13,5 +13,6 @@ class UiText(UiElement):
|
|||||||
|
|
||||||
if font is None:
|
if font is None:
|
||||||
font = pygame.font.Font(None, 12)
|
font = pygame.font.Font(None, 12)
|
||||||
|
self.font = font
|
||||||
|
|
||||||
self.image = font.render(text, antialias, textColor, backgroundColor)
|
self.image = font.render(text, antialias, textColor, backgroundColor)
|
||||||
|
Loading…
Reference in New Issue
Block a user