Update Labels class
This commit is contained in:
@@ -17,4 +17,12 @@ class Label:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
print("Zeichne Surface!")
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ def percent_from_screen(base:int, percent:int) -> int:
|
|||||||
|
|
||||||
game = Game.Game()
|
game = Game.Game()
|
||||||
User = User.User()
|
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))
|
MAINSCREEN.fill((55,148,38))
|
||||||
PLAYGROUND.fill((244,244,244))
|
PLAYGROUND.fill((244,244,244))
|
||||||
for event in pygame.event.get():
|
for event in pygame.event.get():
|
||||||
|
print(event)
|
||||||
if (event.type == pygame.QUIT):
|
if (event.type == pygame.QUIT):
|
||||||
print("Programm wird geschlossen!")
|
print("Programm wird geschlossen!")
|
||||||
#print(spawned_entities, end="\n")
|
#print(spawned_entities, end="\n")
|
||||||
@@ -138,17 +139,18 @@ while active == True:
|
|||||||
|
|
||||||
if(game.get_state("menu")):
|
if(game.get_state("menu")):
|
||||||
pass
|
pass
|
||||||
if(event.type == pygame.KEYDOWN):
|
"""if(event.type == pygame.KEYDOWN):
|
||||||
print(event.unicode)
|
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_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_surface_player = my_font.render("Player: " + User.getusername(), True, SCHWARZ, None)
|
||||||
text_test = my_font.render("Test", True, SCHWARZ, None)
|
text_test = my_font.render("Test", True, SCHWARZ, None)
|
||||||
|
|
||||||
text_out = my_font.render(text, 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)
|
pygame.draw.line(MAINSCREEN, SCHWARZ, (0,38), (MAINSCREEN_SIZE[0], 38), 2)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user