88import pyglet
99from pyglet .enums import Style , Weight
1010
11+ # Pyright can't figure out the dynamic backend imports in pyglet.graphics
12+ # right now. Maybe can fix in future Pyglet version
13+ from pyglet .graphics import Batch , Group # type: ignore
14+
1115import arcade
1216from arcade .exceptions import PerformanceWarning , warning
1317from arcade .resources import resolve
@@ -216,8 +220,8 @@ def __init__(
216220 anchor_y : str = "baseline" ,
217221 multiline : bool = False ,
218222 rotation : float = 0 ,
219- batch : pyglet . graphics . Batch | None = None ,
220- group : pyglet . graphics . Group | None = None ,
223+ batch : Batch | None = None ,
224+ group : Group | None = None ,
221225 z : float = 0 ,
222226 ** kwargs ,
223227 ):
@@ -297,19 +301,19 @@ def __exit__(self, exc_type, exc_val, exc_tb):
297301 self .label .end_update ()
298302
299303 @property
300- def batch (self ) -> pyglet . graphics . Batch | None :
304+ def batch (self ) -> Batch | None :
301305 """The batch this text is in, if any.
302306
303307 Can be unset by setting to ``None``.
304308 """
305309 return self .label .batch
306310
307311 @batch .setter
308- def batch (self , batch : pyglet . graphics . Batch ):
312+ def batch (self , batch : Batch ):
309313 self .label .batch = batch
310314
311315 @property
312- def group (self ) -> pyglet . graphics . Group | None :
316+ def group (self ) -> Group | None :
313317 """
314318 The specific group in a batch the text should belong to.
315319
@@ -320,7 +324,7 @@ def group(self) -> pyglet.graphics.Group | None:
320324 return self .label .group
321325
322326 @group .setter
323- def group (self , group : pyglet . graphics . Group ):
327+ def group (self , group : Group ):
324328 self .label .group = group
325329
326330 @property
0 commit comments