Draws an arrow with a specified color given a transform
(surface, transform, color=COLOR_ALUMINIUM_2)
| 646 | draw_broken_line(surface, markings[1], False, markings[2], 2) |
| 647 | |
| 648 | def draw_arrow(surface, transform, color=COLOR_ALUMINIUM_2): |
| 649 | """ Draws an arrow with a specified color given a transform""" |
| 650 | transform.rotation.yaw += 180 |
| 651 | forward = transform.get_forward_vector() |
| 652 | transform.rotation.yaw += 90 |
| 653 | right_dir = transform.get_forward_vector() |
| 654 | end = transform.location |
| 655 | start = end - 2.0 * forward |
| 656 | right = start + 0.8 * forward + 0.4 * right_dir |
| 657 | left = start + 0.8 * forward - 0.4 * right_dir |
| 658 | |
| 659 | # Draw lines |
| 660 | pygame.draw.lines(surface, color, False, [world_to_pixel(x) for x in [start, end]], 4) |
| 661 | pygame.draw.lines(surface, color, False, [world_to_pixel(x) for x in [left, start, right]], 4) |
| 662 | |
| 663 | def draw_traffic_signs(surface, font_surface, actor, color=COLOR_ALUMINIUM_2, trigger_color=COLOR_PLUM_0): |
| 664 | """Draw stop traffic signs and its bounding box if enabled""" |
no outgoing calls
no test coverage detected