MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / __init__

Method __init__

PythonAPI/examples/manual_control.py:482–498  ·  view source on GitHub ↗
(self, width, height)

Source from the content-addressed store, hash-verified

480
481class 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()

Callers

nothing calls this directly

Calls 2

FadingTextClass · 0.70
HelpTextClass · 0.70

Tested by

no test coverage detected