예제 #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()