Change how UiText renders text
Now UiText renders specified rect surface and on this surface blits text.
This commit is contained in:
parent
7f624fe56e
commit
e73fc03fc4
@ -19,4 +19,8 @@ class UiText(UiElement):
|
||||
font = pygame.font.Font(None, 12)
|
||||
self.font = font
|
||||
|
||||
self.image = font.render(text, antialias, textColor, backgroundColor)
|
||||
self.image = pygame.Surface((rect.w, rect.h))
|
||||
if backgroundColor is not None:
|
||||
self.image.fill(backgroundColor)
|
||||
wordImage = self.font.render(text, antialias, textColor)
|
||||
self.image.blit(wordImage, (0, 0))
|
||||
|
Loading…
Reference in New Issue
Block a user