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

Method __init__

PythonAPI/examples/automatic_control.py:194–210  ·  view source on GitHub ↗
(self, width, height)

Source from the content-addressed store, hash-verified

192
193class 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()

Callers

nothing calls this directly

Calls 2

FadingTextClass · 0.70
HelpTextClass · 0.70

Tested by

no test coverage detected