Renders the help text that shows the controls for using no rendering mode
(self, font, width, height)
| 228 | |
| 229 | class HelpText(object): |
| 230 | def __init__(self, font, width, height): |
| 231 | """Renders the help text that shows the controls for using no rendering mode""" |
| 232 | lines = __doc__.split('\n') |
| 233 | self.font = font |
| 234 | self.dim = (680, len(lines) * 22 + 12) |
| 235 | self.pos = (0.5 * width - 0.5 * self.dim[0], 0.5 * height - 0.5 * self.dim[1]) |
| 236 | self.seconds_left = 0 |
| 237 | self.surface = pygame.Surface(self.dim) |
| 238 | self.surface.fill(COLOR_BLACK) |
| 239 | for n, line in enumerate(lines): |
| 240 | text_texture = self.font.render(line, True, COLOR_WHITE) |
| 241 | self.surface.blit(text_texture, (22, n * 22)) |
| 242 | self._render = False |
| 243 | self.surface.set_alpha(220) |
| 244 | |
| 245 | def toggle(self): |
| 246 | """Toggles display of help text""" |