mirror of
https://github.com/kristoferssolo/2048.git
synced 2025-10-21 15:20:35 +00:00
fix(game): Label
This commit is contained in:
parent
65653457ed
commit
3354f84bbe
@ -17,14 +17,15 @@ class Label(UIElement):
|
|||||||
|
|
||||||
def draw(self, surface: pygame.Surface) -> None:
|
def draw(self, surface: pygame.Surface) -> None:
|
||||||
"""Draw the element on the given surface."""
|
"""Draw the element on the given surface."""
|
||||||
# self._draw_background(surface)
|
self._draw_background(surface)
|
||||||
self._draw_text()
|
self._draw_text()
|
||||||
|
self.image.blit(self.image, (0, 0))
|
||||||
|
|
||||||
def update(self) -> None:
|
def update(self) -> None:
|
||||||
"""Update the sprite."""
|
"""Update the sprite."""
|
||||||
self._draw_background(self.image)
|
self._draw_background(self.image)
|
||||||
self._draw_text()
|
self._draw_text()
|
||||||
self.image.blit(self.rendered_text, self.position)
|
self.image.blit(self.image, (0, 0))
|
||||||
|
|
||||||
def _draw_background(self, surface: pygame.Surface) -> None:
|
def _draw_background(self, surface: pygame.Surface) -> None:
|
||||||
"""Draw a background for the given surface."""
|
"""Draw a background for the given surface."""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user