Sets the text, color and seconds until fade out
(self, text, color=COLOR_WHITE, seconds=2.0)
| 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""" |