(self, width, height)
| 381 | |
| 382 | class HUD(object): |
| 383 | def __init__(self, width, height): |
| 384 | self.dim = (width, height) |
| 385 | font = pygame.font.Font(pygame.font.get_default_font(), 20) |
| 386 | font_name = 'courier' if os.name == 'nt' else 'mono' |
| 387 | fonts = [x for x in pygame.font.get_fonts() if font_name in x] |
| 388 | default_font = 'ubuntumono' |
| 389 | mono = default_font if default_font in fonts else fonts[0] |
| 390 | mono = pygame.font.match_font(mono) |
| 391 | self._font_mono = pygame.font.Font(mono, 12 if os.name == 'nt' else 14) |
| 392 | self._notifications = FadingText(font, (width, 40), (0, height - 40)) |
| 393 | self.help = HelpText(pygame.font.Font(mono, 24), width, height) |
| 394 | self.server_fps = 0 |
| 395 | self.frame = 0 |
| 396 | self.simulation_time = 0 |
| 397 | self._show_info = True |
| 398 | self._info_text = [] |
| 399 | self._server_clock = pygame.time.Clock() |
| 400 | |
| 401 | def on_world_tick(self, timestamp): |
| 402 | self._server_clock.tick() |
nothing calls this directly
no test coverage detected