Builded prototype of labels class

This commit is contained in:
2024-02-09 21:39:35 +01:00
parent 907da56d23
commit 187803d3f7
3 changed files with 39 additions and 0 deletions

19
modules/Labels.py Normal file
View File

@@ -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

View File

@@ -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()

19
test.py Normal file
View File

@@ -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)