MCPcopy Create free account
hub / github.com/Mrinank-Bhowmick/python-beginner-projects / Text

Class Text

projects/Space Shooter/main.py:22–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21
22class Text:
23 def __init__(self, text: str, size: int):
24 self.text = text
25 self.size = size
26 self.selected = False
27
28 def display(self):
29 # Change the color if selected
30 color = (255, 0, 0) if self.selected else (255, 255, 255)
31 font = pygame.font.Font("SHPinscher-Regular.otf", self.size)
32 return font.render(self.text, True, color)
33
34
35class Menu:

Callers 8

Audio_Captcha.pyFile · 0.85
encryptFunction · 0.85
decryptFunction · 0.85
main_screenFunction · 0.85
__init__Method · 0.85
textMethod · 0.85
textMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected