From 3489ae90ad696380806d56fe222391959f5f1945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20W=C3=A4chter?= Date: Sat, 25 Mar 2023 18:13:59 +0100 Subject: [PATCH] =?UTF-8?q?test=20texte=20f=C3=BCr=20TextLabel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/main.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/project/main.py b/project/main.py index b05acd9..55182e9 100644 --- a/project/main.py +++ b/project/main.py @@ -12,7 +12,7 @@ from sprite.Sprite import Sprite from sprite.StaticSprite import StaticSprite from ui_elements.TextLabel import TextLabel -what_to_run = 'physics' +what_to_run = 'textlabel' def apply_frame_rate(number: float): @@ -84,11 +84,13 @@ elif what_to_run == 'textlabel': screen_transform = PositionScale((0, 0), (4, 4)) pygame.init() - screen = pygame.display.set_mode((300, 300)) + screen = pygame.display.set_mode((800, 800)) pygame.display.set_caption("PM GAME") clock = pygame.time.Clock() - test = TextLabel("Das ist ein Text", 100, 100, 50, Font('data/font/MilkyNice.otf', 50)) + test1 = TextLabel("Das ist ein Test", 400, 0, 50, alignment="left") + test2 = TextLabel("Das ist ein Test", 400, 10, 50, alignment="center") + test3 = TextLabel("Das ist ein Test", 400, 20, 50, alignment="right") while True: clock.tick(5) @@ -97,9 +99,12 @@ elif what_to_run == 'textlabel': if event.type == pygame.QUIT: pygame.quit() - screen.fill((0, 0, 0)) + screen.fill((0, 0, 110)) + + test1.draw(screen, screen_transform) + test2.draw(screen, screen_transform) + test3.draw(screen, screen_transform) - test.draw(screen, screen_transform) pygame.display.update()