(self, width, height)
| 480 | |
| 481 | class HUD(object): |
| 482 | def __init__(self, width, height): |
| 483 | self.dim = (width, height) |
| 484 | font = pygame.font.Font(pygame.font.get_default_font(), 20) |
| 485 | font_name = 'courier' if os.name == 'nt' else 'mono' |
| 486 | fonts = [x for x in pygame.font.get_fonts() if font_name in x] |
| 487 | default_font = 'ubuntumono' |
| 488 | mono = default_font if default_font in fonts else fonts[0] |
| 489 | mono = pygame.font.match_font(mono) |
| 490 | self._font_mono = pygame.font.Font(mono, 12 if os.name == 'nt' else 14) |
| 491 | self._notifications = FadingText(font, (width, 40), (0, height - 40)) |
| 492 | self.help = HelpText(pygame.font.Font(mono, 16), width, height) |
| 493 | self.server_fps = 0 |
| 494 | self.frame = 0 |
| 495 | self.simulation_time = 0 |
| 496 | self._show_info = True |
| 497 | self._info_text = [] |
| 498 | self._server_clock = pygame.time.Clock() |
| 499 | |
| 500 | def on_world_tick(self, timestamp): |
| 501 | self._server_clock.tick() |
nothing calls this directly
no test coverage detected