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

Method __init__

PythonAPI/examples/manual_control_rss.py:599–611  ·  view source on GitHub ↗
(self, font, width, height)

Source from the content-addressed store, hash-verified

597
598class HelpText(object):
599 def __init__(self, font, width, height):
600 lines = __doc__.split('\n')
601 self.font = font
602 self.dim = (680, len(lines) * 22 + 12)
603 self.pos = (0.5 * width - 0.5 * self.dim[0], 0.5 * height - 0.5 * self.dim[1])
604 self.seconds_left = 0
605 self.surface = pygame.Surface(self.dim)
606 self.surface.fill((0, 0, 0, 0))
607 for n, line in enumerate(lines):
608 text_texture = self.font.render(line, True, (255, 255, 255))
609 self.surface.blit(text_texture, (22, n * 22))
610 self._render = False
611 self.surface.set_alpha(220)
612
613 def toggle(self):
614 self._render = not self._render

Callers

nothing calls this directly

Calls 1

renderMethod · 0.45

Tested by

no test coverage detected