|
28 | 28 | from arcade.gl.buffer import Buffer |
29 | 29 | from arcade.gl.types import BlendFunction, OpenGlFilter, PyGLenum |
30 | 30 | from arcade.gl.vertex_array import Geometry |
31 | | -from arcade.types import RGBA255, Color, RGBANormalized, RGBOrA255, RGBOrANormalized |
| 31 | +from arcade.types import RGBA255, Color, Point2, RGBANormalized, RGBOrA255, RGBOrANormalized |
32 | 32 | from arcade.utils import copy_dunders_unimplemented |
33 | 33 |
|
34 | 34 | if TYPE_CHECKING: |
@@ -1114,10 +1114,22 @@ def draw_hit_boxes( |
1114 | 1114 | color: The color of the hit boxes |
1115 | 1115 | line_thickness: The thickness of the lines |
1116 | 1116 | """ |
| 1117 | + import arcade |
| 1118 | + |
1117 | 1119 | converted_color = Color.from_iterable(color) |
| 1120 | + points: list[Point2] = [] |
1118 | 1121 |
|
| 1122 | + # TODO: Make this faster in the future |
| 1123 | + # NOTE: This will be easier when/if we change to triangles |
1119 | 1124 | for sprite in self.sprite_list: |
1120 | | - sprite.draw_hit_box(converted_color, line_thickness) |
| 1125 | + adjusted_points = sprite.hit_box.get_adjusted_points() |
| 1126 | + for i in range(len(adjusted_points) - 1): |
| 1127 | + points.append(adjusted_points[i]) |
| 1128 | + points.append(adjusted_points[i + 1]) |
| 1129 | + points.append(adjusted_points[-1]) |
| 1130 | + points.append(adjusted_points[0]) |
| 1131 | + |
| 1132 | + arcade.draw_lines(points, color=converted_color, line_width=line_thickness) |
1121 | 1133 |
|
1122 | 1134 | def _normalize_index_buffer(self) -> None: |
1123 | 1135 | """ |
|
0 commit comments