MCPcopy Create free account
hub / github.com/OpenDriveLab/DriveAdapter / __init__

Method __init__

scenario_runner/no_rendering_mode.py:256–268  ·  view source on GitHub ↗
(self, font, width, height)

Source from the content-addressed store, hash-verified

254
255class HelpText(object):
256 def __init__(self, font, width, height):
257 lines = __doc__.split('\n')
258 self.font = font
259 self.dim = (680, len(lines) * 22 + 12)
260 self.pos = (0.5 * width - 0.5 * self.dim[0], 0.5 * height - 0.5 * self.dim[1])
261 self.seconds_left = 0
262 self.surface = pygame.Surface(self.dim)
263 self.surface.fill(COLOR_BLACK)
264 for n, line in enumerate(lines):
265 text_texture = self.font.render(line, True, COLOR_WHITE)
266 self.surface.blit(text_texture, (22, n * 22))
267 self._render = False
268 self.surface.set_alpha(220)
269
270 def toggle(self):
271 self._render = not self._render

Callers

nothing calls this directly

Calls 1

renderMethod · 0.45

Tested by

no test coverage detected