SZI2019SmieciarzWmi/sprites/hud.py

25 lines
991 B
Python
Raw Normal View History

2019-03-25 16:10:51 +01:00
import pygame
from config import HUD_HEIGHT
HUD_COLOR = (51,21,4)
WHITE = (255,255,255)
class Hud():
texts = []
def __init__(self,house_amount,WINDOW_WIDTH, WINDOW_HEIGHT,GAMEWINDOW):
pygame.init()
hud_upper = WINDOW_WIDTH - HUD_HEIGHT
hud_lower = WINDOW_WIDTH
height = hud_upper - hud_lower
font_type = 'fonts/Bazgroly.ttf'
font_size = house_amount * 2
GAMEWINDOW.fill(HUD_COLOR)
font = pygame.font.Font(font_type, font_size)
gc_plastic_text = font.render("Plastic: 0/0",True,WHITE)
gc_metal_text = font.render("Metal: 0/0",True,WHITE)
gc_glass_text = font.render("Glass: 0/0",True,WHITE)
map_plastic_text = font.render("Plastic: 0",True,WHITE)
map_metal_text = font.render("Metal: 0",True,WHITE)
map_glass_text = font.render("Glass: 0",True,WHITE)
overall_text = font.render("Garbage thrown away: 0",True,WHITE)
GAMEWINDOW.blit(overall_text,(20, 20))