(self, width, height)
| 192 | |
| 193 | class HUD(object): |
| 194 | def __init__(self, width, height): |
| 195 | self.dim = (width, height) |
| 196 | font = pygame.font.Font(pygame.font.get_default_font(), 20) |
| 197 | font_name = 'courier' if os.name == 'nt' else 'mono' |
| 198 | fonts = [x for x in pygame.font.get_fonts() if font_name in x] |
| 199 | default_font = 'ubuntumono' |
| 200 | mono = default_font if default_font in fonts else fonts[0] |
| 201 | mono = pygame.font.match_font(mono) |
| 202 | self._font_mono = pygame.font.Font(mono, 12 if os.name == 'nt' else 14) |
| 203 | self._notifications = FadingText(font, (width, 40), (0, height - 40)) |
| 204 | self.help = HelpText(pygame.font.Font(mono, 24), width, height) |
| 205 | self.server_fps = 0 |
| 206 | self.frame = 0 |
| 207 | self.simulation_time = 0 |
| 208 | self._show_info = True |
| 209 | self._info_text = [] |
| 210 | self._server_clock = pygame.time.Clock() |
| 211 | |
| 212 | def on_world_tick(self, timestamp): |
| 213 | self._server_clock.tick() |
nothing calls this directly
no test coverage detected