示例#1
0
    def __init__(self):
        """Initialize a new button.

        The mode is set to 'normal'.

        """
        GuiSprite.__init__(self)
        self._draw_function = None
        self.setMode('normal')
示例#2
0
    def _draw(self):
        """Draw the window onto its own surface: background and sprites.

        Warning: this DOES NOT call the method _draw of the sprites of the
        _sprites_group.  It draws them as they are.

        """
        GuiSprite._draw(self)
        self._drawSprites()
示例#3
0
    def update(self):
        """(Re)create the sprite image from scratch.

        Starts by calling update() on all the sprites of _sprites_group.

        Call this method only when you need it.  Not at every frame.

        """
        self._sprites_group.update()
        GuiSprite.update(self)
示例#4
0
 def __init__(self):
     """Initialize a new TextSprite."""
     GuiSprite.__init__(self)
     self.font = None
     self.text = ''
示例#5
0
 def __init__(self):
     GuiSprite.__init__(self)
     self._sprites_group = pygame.sprite.LayeredUpdates()