MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / set_text

Method set_text

PythonAPI/examples/no_rendering_mode.py:205–211  ·  view source on GitHub ↗

Sets the text, color and seconds until fade out

(self, text, color=COLOR_WHITE, seconds=2.0)

Source from the content-addressed store, hash-verified

203 self.surface = pygame.Surface(self.dim)
204
205 def set_text(self, text, color=COLOR_WHITE, seconds=2.0):
206 """Sets the text, color and seconds until fade out"""
207 text_texture = self.font.render(text, True, color)
208 self.surface = pygame.Surface(self.dim)
209 self.seconds_left = seconds
210 self.surface.fill(COLOR_BLACK)
211 self.surface.blit(text_texture, (10, 11))
212
213 def tick(self, clock):
214 """Each frame, it shows the displayed text for some specified seconds, if any"""

Callers 1

notificationMethod · 0.45

Calls 1

renderMethod · 0.45

Tested by

no test coverage detected