(self, surface, list_sl, world_to_pixel, world_to_pixel_width)
| 1037 | surface.blit(srf, srf.get_rect(center=pos)) |
| 1038 | |
| 1039 | def _render_speed_limits(self, surface, list_sl, world_to_pixel, world_to_pixel_width): |
| 1040 | |
| 1041 | font_size = world_to_pixel_width(2) |
| 1042 | radius = world_to_pixel_width(2) |
| 1043 | font = pygame.font.SysFont('Arial', font_size) |
| 1044 | |
| 1045 | for sl in list_sl: |
| 1046 | |
| 1047 | x, y = world_to_pixel(sl.get_location()) |
| 1048 | |
| 1049 | # Render speed limit |
| 1050 | white_circle_radius = int(radius * 0.75) |
| 1051 | |
| 1052 | pygame.draw.circle(surface, COLOR_SCARLET_RED_1, (x, y), radius) |
| 1053 | pygame.draw.circle(surface, COLOR_ALUMINIUM_0, (x, y), white_circle_radius) |
| 1054 | |
| 1055 | limit = sl.type_id.split('.')[2] |
| 1056 | font_surface = font.render(limit, True, COLOR_ALUMINIUM_5) |
| 1057 | |
| 1058 | if self.args.show_triggers: |
| 1059 | corners = Util.get_bounding_box(sl) |
| 1060 | corners = [world_to_pixel(p) for p in corners] |
| 1061 | pygame.draw.lines(surface, COLOR_PLUM_2, True, corners, 2) |
| 1062 | |
| 1063 | # Blit |
| 1064 | if self.hero_actor is not None: |
| 1065 | # Rotate font surface with respect to hero vehicle front |
| 1066 | angle = -self.hero_transform.rotation.yaw - 90.0 |
| 1067 | font_surface = pygame.transform.rotate(font_surface, angle) |
| 1068 | offset = font_surface.get_rect(center=(x, y)) |
| 1069 | surface.blit(font_surface, offset) |
| 1070 | |
| 1071 | else: |
| 1072 | surface.blit(font_surface, (x - radius / 2, y - radius / 2)) |
| 1073 | |
| 1074 | def _render_walkers(self, surface, list_w, world_to_pixel): |
| 1075 | for w in list_w: |
no test coverage detected