Update Labels class

This commit is contained in:
2024-02-14 21:04:05 +01:00
parent 2e9bbc7d19
commit 3589bd49ee
2 changed files with 16 additions and 6 deletions

View File

@@ -17,4 +17,12 @@ class Label:
else:
print("Zeichne Surface!")
pass
pass
class Input_Label(Label):
def __init__(self, is_rect=False, pos=tuple, size=tuple, mainsurface=pygame.Surface) -> None:
super().__init__(is_rect, pos, size, mainsurface)

View File

@@ -72,7 +72,7 @@ def percent_from_screen(base:int, percent:int) -> int:
game = Game.Game()
User = User.User()
input_label = Label.Label(True, (50,50), (100,25), PLAYGROUND)
input_label1 = Label.Input_Label(True, (50,50), (100,25), PLAYGROUND)
@@ -113,6 +113,7 @@ while active == True:
MAINSCREEN.fill((55,148,38))
PLAYGROUND.fill((244,244,244))
for event in pygame.event.get():
print(event)
if (event.type == pygame.QUIT):
print("Programm wird geschlossen!")
#print(spawned_entities, end="\n")
@@ -138,17 +139,18 @@ while active == True:
if(game.get_state("menu")):
pass
if(event.type == pygame.KEYDOWN):
"""if(event.type == pygame.KEYDOWN):
print(event.unicode)
text += event.unicode
text += event.unicode"""
text_surface_score = my_font.render('Score: '+str(player.get_player_score()), True, (0, 0, 0))
text_surface_player = my_font.render("Player: " + User.getusername(), True, SCHWARZ, None)
text_test = my_font.render("Test", True, SCHWARZ, None)
text_out = my_font.render(text, True, SCHWARZ, None)
input_label.draw()
#input_label1.draw()
pygame.draw.line(MAINSCREEN, SCHWARZ, (0,38), (MAINSCREEN_SIZE[0], 38), 2)