From 187803d3f728c931e3c38c0b6cccc4f0edbf5fb9 Mon Sep 17 00:00:00 2001 From: administrator Date: Fri, 9 Feb 2024 21:39:35 +0100 Subject: [PATCH] Builded prototype of labels class --- modules/Labels.py | 19 +++++++++++++++++++ pygame-test.py | 1 + test.py | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 modules/Labels.py create mode 100644 test.py diff --git a/modules/Labels.py b/modules/Labels.py new file mode 100644 index 0000000..814c863 --- /dev/null +++ b/modules/Labels.py @@ -0,0 +1,19 @@ +import pygame + +class Label: + def __init__(self, surface:pygame.Surface, is_rect=False, pos=tuple) -> None: + self._surface = surface + self._is_rect = is_rect + self._pos = pos + + + def input_label(self): + pass + + def draw(self): + if(self._is_rect): + print("Zeichne ein Rechteck") + + else: + print("Zeichne Surface!") + pass \ No newline at end of file diff --git a/pygame-test.py b/pygame-test.py index fe69805..51cef3d 100644 --- a/pygame-test.py +++ b/pygame-test.py @@ -3,6 +3,7 @@ import pygame_menu import random as rand import modules.User as User import modules.Game_new as Game +import modules.Labels as Label from modules.GameObject import * pygame.init() diff --git a/test.py b/test.py new file mode 100644 index 0000000..f4ec446 --- /dev/null +++ b/test.py @@ -0,0 +1,19 @@ +def test(string=str()): + #print(string) + return string + +func_list = [ ] + +i=0 +for anzahl in range(50): + func_list.append(test("string-"+str(i))) + i += 1 + +for func in func_list: + if(func == "string-30"): + print("Ziel erreicht!") + print(func) + +for count, func in enumerate(func_list): + print(count, func) +