feat(text_input): add text input class with initialization

This commit is contained in:
Kevin Baumgartner
2026-05-07 20:55:22 +02:00
parent dee0abefbc
commit dbbd40b58a
+20
View File
@@ -0,0 +1,20 @@
import pygame
class TextInput:
def __init__(self, width, height, pos_x, pos_y):
self.rect = pygame.Rect(pos_x, pos_y, width, height)
self.font = pygame.font.SysFont("Arial", 22)
# input text
self.text = ""
self.active = True
# colors
self.text_color = (255, 255, 255)
self.border_color = (255, 255, 255)
self.active_border_color = (0, 255, 0)
self.background_color = (30, 30, 30)