24
24
cast ,
25
25
)
26
26
27
- from arcade import (
28
- Sprite ,
29
- SpriteType ,
30
- get_window ,
31
- gl ,
32
- )
27
+ from arcade import Sprite , SpriteType , get_window , gl
33
28
from arcade .gl import Program , Texture2D
34
29
from arcade .gl .buffer import Buffer
35
30
from arcade .gl .types import BlendFunction , OpenGlFilter , PyGLenum
36
31
from arcade .gl .vertex_array import Geometry
37
- from arcade .types import RGBA255 , Color , RGBANormalized , RGBOrANormalized
32
+ from arcade .types import RGBA255 , Color , RGBANormalized , RGBOrA255 , RGBOrANormalized
38
33
from arcade .utils import copy_dunders_unimplemented
39
34
40
35
if TYPE_CHECKING :
@@ -1131,7 +1126,9 @@ def draw(
1131
1126
if blend_function is not None :
1132
1127
self .ctx .blend_func = prev_blend_func
1133
1128
1134
- def draw_hit_boxes (self , color : RGBA255 = (0 , 0 , 0 , 255 ), line_thickness : float = 1.0 ) -> None :
1129
+ def draw_hit_boxes (
1130
+ self , color : RGBOrA255 = (0 , 0 , 0 , 255 ), line_thickness : float = 1.0
1131
+ ) -> None :
1135
1132
"""
1136
1133
Draw all the hit boxes in this list.
1137
1134
@@ -1141,9 +1138,10 @@ def draw_hit_boxes(self, color: RGBA255 = (0, 0, 0, 255), line_thickness: float
1141
1138
color: The color of the hit boxes
1142
1139
line_thickness: The thickness of the lines
1143
1140
"""
1144
- # NOTE: Find a way to efficiently draw this
1141
+ converted_color = Color .from_iterable (color )
1142
+
1145
1143
for sprite in self .sprite_list :
1146
- sprite .draw_hit_box (color , line_thickness )
1144
+ sprite .draw_hit_box (converted_color , line_thickness )
1147
1145
1148
1146
def _normalize_index_buffer (self ) -> None :
1149
1147
"""
0 commit comments