Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions arcade/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from arcade import Sprite, SpriteList
from arcade.gl.types import BlendFunction, OpenGlFilter
from arcade.tilemap import TileMap
from arcade.types import RGBA255, Color
from arcade.types import Color, RGBOrA255

__all__ = ["Scene", "SceneKeyError"]

Expand Down Expand Up @@ -499,7 +499,7 @@ def draw(

def draw_hit_boxes(
self,
color: RGBA255 = Color(0, 0, 0, 255),
color: RGBOrA255 = Color(0, 0, 0, 255),
line_thickness: float = 1.0,
names: Iterable[str] | None = None,
) -> None:
Expand Down
7 changes: 4 additions & 3 deletions arcade/sprite/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from arcade.exceptions import ReplacementWarning, warning
from arcade.hitbox import HitBox
from arcade.texture import Texture
from arcade.types import LRBT, RGBA255, AsFloat, Color, Point, Point2, Point2List, Rect, RGBOrA255
from arcade.types import LRBT, AsFloat, Color, Point, Point2, Point2List, Rect, RGBOrA255
from arcade.utils import copy_dunders_unimplemented

if TYPE_CHECKING:
Expand Down Expand Up @@ -764,7 +764,7 @@ def remove_from_sprite_lists(self) -> None:

# ----- Drawing Methods -----

def draw_hit_box(self, color: RGBA255 = BLACK, line_thickness: float = 2.0) -> None:
def draw_hit_box(self, color: RGBOrA255 = BLACK, line_thickness: float = 2.0) -> None:
"""
Draw a sprite's hit-box. This is useful for debugging.

Expand All @@ -774,10 +774,11 @@ def draw_hit_box(self, color: RGBA255 = BLACK, line_thickness: float = 2.0) -> N
line_thickness:
How thick the box should be
"""
converted_color = Color.from_iterable(color)
points: Point2List = self.hit_box.get_adjusted_points()
# NOTE: This is a COPY operation. We don't want to modify the points.
points = tuple(points) + tuple(points[:-1])
arcade.draw_line_strip(points, color=color, line_width=line_thickness)
arcade.draw_line_strip(points, color=converted_color, line_width=line_thickness)

# ---- Shortcut Methods ----

Expand Down
Loading