Exemplo n.º 1
0
    def __init__(self, app, area):
        super(GaugeBase, self).__init__(app)
        self.area = area

        self.icon = self.getIcon()
        if self.icon is not None:
            self.icon = self.icon.copy()
            setAlpha(self.icon, 160)
Exemplo n.º 2
0
 def doTransform(self, img):
     grey_colour = (100, 100, 100)
     result = pygame.Surface(img.get_size())
     result.fill(grey_colour)
     setAlpha(img, 32)
     result.blit(img, (0, 0))
     result.set_colorkey(grey_colour)
     return result
Exemplo n.º 3
0
 def update(self):
     self.image = self.animation.getImage()
     tick = self.worldGUI.universe.getMonotonicTick()
     fadeTick = self.coin.creationTick + (COLLECTABLE_COIN_LIFETIME -
                                          2) // TICK_PERIOD
     if tick >= fadeTick:
         alpha = random.randint(32, 192)
         self.image = self.image.copy()
         setAlpha(self.image, alpha, alphaSurface=self.alphaImage)
Exemplo n.º 4
0
 def setImageAlpha(self, alpha):
     setAlpha(self.image, alpha, alphaSurface=self.alphaImage)
Exemplo n.º 5
0
 def set_image_alpha(self, surface, alpha):
     if self._alpha_image is None \
             or self._alpha_image.get_size() != surface.get_size():
         self._alpha_image = pygame.Surface(
             surface.get_size(), pygame.SRCALPHA)
     setAlpha(surface, alpha, alphaSurface=self._alpha_image)
Exemplo n.º 6
0
 def bigZoneLetter(self, letter):
     font = self.theme.app.screenManager.fonts.bigZoneFont
     result = font.render(self.theme.app, letter, True,
                          self.theme.colours.bigZoneLetter)
     setAlpha(result, 128)
     return result