import pygame import sys pygame.init() display = pygame.display.set_mode ((400, 300)) class TextInput(pygame.sprite.Sprite): def_init_(self, x, y, width=100, height=50, color=(0,0,0), bgcolor=(0, 255, 0), selectedColor=(0, 0, 255)): super()._init_() #Initialize text input properties self.text_value = "" #initial text value self.isSelected = False #shows whether the text input is currently selected self.color = color #text color self.bgcolor = bgcolor self.SelectedColor = selectedColor