def __init__(self): """Initialize a new button. The mode is set to 'normal'. """ GuiSprite.__init__(self) self._draw_function = None self.setMode('normal')
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()
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)
def __init__(self): """Initialize a new TextSprite.""" GuiSprite.__init__(self) self.font = None self.text = ''
def __init__(self): GuiSprite.__init__(self) self._sprites_group = pygame.sprite.LayeredUpdates()