Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions arcade/sprite_list/sprite_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from arcade.gl.buffer import Buffer
from arcade.gl.types import BlendFunction, OpenGlFilter, PyGLenum
from arcade.gl.vertex_array import Geometry
from arcade.types import RGBA255, Color, RGBANormalized, RGBOrA255, RGBOrANormalized
from arcade.types import RGBA255, Color, Point2, RGBANormalized, RGBOrA255, RGBOrANormalized
from arcade.utils import copy_dunders_unimplemented

if TYPE_CHECKING:
Expand Down Expand Up @@ -1114,10 +1114,22 @@ def draw_hit_boxes(
color: The color of the hit boxes
line_thickness: The thickness of the lines
"""
import arcade

converted_color = Color.from_iterable(color)
points: list[Point2] = []

# TODO: Make this faster in the future
# NOTE: This will be easier when/if we change to triangles
for sprite in self.sprite_list:
sprite.draw_hit_box(converted_color, line_thickness)
adjusted_points = sprite.hit_box.get_adjusted_points()
for i in range(len(adjusted_points) - 1):
points.append(adjusted_points[i])
points.append(adjusted_points[i + 1])
points.append(adjusted_points[-1])
points.append(adjusted_points[0])

arcade.draw_lines(points, color=converted_color, line_width=line_thickness)

def _normalize_index_buffer(self) -> None:
"""
Expand Down
Loading