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

Method __init__

PythonAPI/examples/manual_control_steeringwheel.py:549–561  ·  view source on GitHub ↗
(self, font, width, height)

Source from the content-addressed store, hash-verified

547
548class HelpText(object):
549 def __init__(self, font, width, height):
550 lines = __doc__.split('\n')
551 self.font = font
552 self.dim = (680, len(lines) * 22 + 12)
553 self.pos = (0.5 * width - 0.5 * self.dim[0], 0.5 * height - 0.5 * self.dim[1])
554 self.seconds_left = 0
555 self.surface = pygame.Surface(self.dim)
556 self.surface.fill((0, 0, 0, 0))
557 for n, line in enumerate(lines):
558 text_texture = self.font.render(line, True, (255, 255, 255))
559 self.surface.blit(text_texture, (22, n * 22))
560 self._render = False
561 self.surface.set_alpha(220)
562
563 def toggle(self):
564 self._render = not self._render

Callers

nothing calls this directly

Calls 1

renderMethod · 0.45

Tested by

no test coverage detected