Commit 73bb21fa authored by Alan Aguiar's avatar Alan Aguiar
Browse files

bigger surface for score

parent fe58932b
......@@ -42,7 +42,7 @@ class CurrentScore(pygame.sprite.Sprite):
self.mPos = [x, y]
self.points = 0
self.image = back
self.size = (50, 50)
self.size = [50, 50]
self.font = pygame.font.Font('DejaVuSans-Bold.ttf', 50)
self.fgColor = (255, 255, 255)
self.bgColor = (113, 197, 207)
......@@ -53,12 +53,12 @@ class CurrentScore(pygame.sprite.Sprite):
self._update_image()
def _update_image(self):
fontSurface = self.font.render(str(self.points), True, self.fgColor)
self.size[0] = fontSurface.get_width()
self.image = pygame.Surface(self.size)
self.image.fill(self.bgColor)
self.image.set_colorkey(self.bgColor)
fontSurface = self.font.render(str(self.points), True, self.fgColor)
xPos = (self.image.get_width() - fontSurface.get_width())/2
self.image.blit(fontSurface, (xPos, 0))
self.image.blit(fontSurface, (0, 0))
self.rect = self.image.get_rect()
self.rect.x = self.mPos[0]
self.rect.y = self.mPos[1]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment