本文整理汇总了Python中pygame.sprite.RenderUpdates.add_internal方法的典型用法代码示例。如果您正苦于以下问题:Python RenderUpdates.add_internal方法的具体用法?Python RenderUpdates.add_internal怎么用?Python RenderUpdates.add_internal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pygame.sprite.RenderUpdates
的用法示例。
在下文中一共展示了RenderUpdates.add_internal方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_ontop
# 需要导入模块: from pygame.sprite import RenderUpdates [as 别名]
# 或者: from pygame.sprite.RenderUpdates import add_internal [as 别名]
def add_ontop(self, ref_sprite, sprite):
""" Add the sprite to the group on top ref_sprite.
The sprite will be added on top of ref sprite so ref_sprite is
below of it.
"""
RenderUpdates.add_internal(self, sprite)
i = self._spritelist.index(ref_sprite)
self._spritelist.insert(i, sprite)
sprite.add_internal(self)
示例2: add_below
# 需要导入模块: from pygame.sprite import RenderUpdates [as 别名]
# 或者: from pygame.sprite.RenderUpdates import add_internal [as 别名]
def add_below(self, ref_sprite, sprite):
""" Add the sprite to the group below ref_sprite.
The sprite will be added below ref sprite so ref_sprite is
on top of it.
"""
RenderUpdates.add_internal(self, sprite)
i = self._spritelist.index(ref_sprite)
self._spritelist.insert(i+1, sprite)
sprite.add_internal(self)
示例3: add_internal
# 需要导入模块: from pygame.sprite import RenderUpdates [as 别名]
# 或者: from pygame.sprite.RenderUpdates import add_internal [as 别名]
def add_internal (self, sprite):
"""RenderLayer.add_internal (...) -> None
"""
if sprite in self.spritedict:
return
RenderUpdates.add_internal (self, sprite)
if sprite.depth == 0:
self.sprite_depths.insert (0, sprite)
else:
success = False
for i in range (len (self.sprite_depths) - 1):
candidate = self.sprite_depths[i]
if sprite.depth < candidate.depth:
self.sprite_depths.insert (i, sprite)
success = True
break
if not success:
self.sprite_depths.append (sprite)
示例4: add_internal
# 需要导入模块: from pygame.sprite import RenderUpdates [as 别名]
# 或者: from pygame.sprite.RenderUpdates import add_internal [as 别名]
def add_internal( self, sprite ):
RenderUpdates.add_internal( self, sprite )
center = self.bgMangr.GetDisplayCenter(sprite.rect)
self.displayRects[sprite] = sprite.rect.move(0,0) #copy
self.displayRects[sprite].center = center
示例5: addObjects
# 需要导入模块: from pygame.sprite import RenderUpdates [as 别名]
# 或者: from pygame.sprite.RenderUpdates import add_internal [as 别名]
def addObjects(self, newDrawableObjects):
for sprite in newDrawableObjects:
RenderUpdates.add_internal(self, sprite)
self._spritelist.insert(len(self._spritelist) - 1, [sprite, sprite.getXPos(), sprite.getYPos()])
示例6: addObject
# 需要导入模块: from pygame.sprite import RenderUpdates [as 别名]
# 或者: from pygame.sprite.RenderUpdates import add_internal [as 别名]
def addObject(self, newDrawableObject):
RenderUpdates.add_internal(self, newDrawableObject)
self._spritelist.insert(len(self._spritelist) - 1, [newDrawableObject, newDrawableObject.getXPos(), newDrawableObject.getYPos()])
示例7: add_internal
# 需要导入模块: from pygame.sprite import RenderUpdates [as 别名]
# 或者: from pygame.sprite.RenderUpdates import add_internal [as 别名]
def add_internal( self, sprite ):
RenderUpdates.add_internal( self, sprite )
center = self.bgMangr.GetDisplayCenter(sprite.rect)
sprite.displayRect.center = center