mirror of
https://github.com/kristoferssolo/2048.git
synced 2025-10-21 15:20:35 +00:00
20 lines
591 B
Python
20 lines
591 B
Python
import pygame
|
|
from py2048 import Config
|
|
from py2048.objects import Label
|
|
|
|
|
|
class Header:
|
|
def __init__(self) -> None:
|
|
self.rect = pygame.Rect(0, 0, Config.HEADER_WIDTH, Config.HEADER_HEIGHT)
|
|
|
|
def draw(self, screen: pygame.Surface, score: int) -> None:
|
|
"""Draw the header."""
|
|
score = Label(
|
|
text=f"{score}",
|
|
position=(10, 10),
|
|
bg_color=Config.COLORSCHEME.BOARD_BG,
|
|
font_family=Config.FONT_FAMILY,
|
|
font_color=Config.COLORSCHEME.DARK_TEXT,
|
|
font_size=Config.FONT_SIZE,
|
|
).draw(screen)
|