@@ -132,6 +132,35 @@ def draw(
132132 """
133133 ...
134134
135+ @abstractmethod
136+ def draw_range (
137+ self ,
138+ start : int = 0 ,
139+ stop : int | None = None ,
140+ * ,
141+ filter : PyGLenum | OpenGlFilter | None = None ,
142+ pixelated : bool | None = None ,
143+ blend_function : BlendFunction | None = None ,
144+ ) -> None :
145+ """Draw the sprites selected by ``sprite_list[start:stop]``.
146+
147+ The bounds follow Python slicing: ``stop`` is exclusive, negative
148+ indices count from the end, and out-of-range bounds are clipped.
149+ The sprites keep their list order, without creating a temporary list.
150+
151+ Args:
152+ start: Index of the first sprite to draw.
153+ stop: Exclusive end index. ``None`` draws to the end of the list.
154+ filter: Optional OpenGL texture filter, as in :meth:`draw`.
155+ pixelated: Whether to use pixelated rendering, as in :meth:`draw`.
156+ blend_function: Optional OpenGL blend function, as in :meth:`draw`.
157+
158+ Raises:
159+ ValueError: A custom texture-storage shader does not support the
160+ ``sprite_start`` uniform required for a nonzero start index.
161+ """
162+ ...
163+
135164 @abstractmethod
136165 def draw_hit_boxes (
137166 self , color : RGBOrA255 = (0 , 0 , 0 , 255 ), line_thickness : float = 1.0
@@ -1081,23 +1110,6 @@ def draw_range(
10811110 pixelated : bool | None = None ,
10821111 blend_function : BlendFunction | None = None ,
10831112 ) -> None :
1084- """Draw the sprites selected by ``sprite_list[start:stop]``.
1085-
1086- The bounds follow Python slicing: ``stop`` is exclusive, negative
1087- indices count from the end, and out-of-range bounds are clipped.
1088- The sprites keep their list order, without creating a temporary list.
1089-
1090- Args:
1091- start: Index of the first sprite to draw.
1092- stop: Exclusive end index. ``None`` draws to the end of the list.
1093- filter: Optional OpenGL texture filter, as in :meth:`draw`.
1094- pixelated: Whether to use pixelated rendering, as in :meth:`draw`.
1095- blend_function: Optional OpenGL blend function, as in :meth:`draw`.
1096-
1097- Raises:
1098- ValueError: A custom texture-storage shader does not support the
1099- ``sprite_start`` uniform required for a nonzero start index.
1100- """
11011113 start , stop , _ = slice (start , stop ).indices (len (self .sprite_list ))
11021114 if stop <= start or not self ._visible or self .alpha_normalized == 0.0 :
11031115 return
0 commit comments