def __init__(self, *sprites, **kwargs):
"""Same as for the pygame.sprite.Group.
pygame.sprite.LayeredDirty(*spites, **kwargs): return LayeredDirty
You can specify some additional attributes through kwargs:
_use_update: True/False default is False
_default_layer: the default layer where the sprites without a layer are
added.
_time_threshold: treshold time for switching between dirty rect mode and
fullscreen mode, defaults to 1000./80 == 1000./fps
"""
LayeredUpdates.__init__(self, *sprites, **kwargs)
self._clip = None
self._use_update = False
self._time_threshold = 1000./80. # 1000./ fps
self._bgd = None
for key, val in kwargs.items():
if key in ['_use_update', '_time_threshold', '_default_layer']:
if hasattr(self, key):
setattr(self, key, val)
评论列表
文章目录