alpha transform; made seed cursor transparent
authoradrianna <adrianna.pinska@gmail.com>
Fri, 9 Sep 2016 20:55:07 +0000 (22:55 +0200)
committeradrianna <adrianna.pinska@gmail.com>
Fri, 9 Sep 2016 20:55:07 +0000 (22:55 +0200)
tabakrolletjie/scenes/day.py
tabakrolletjie/transforms.py

index fc79ffce07f41a69d13b472aa2d70b3676365388..4af1d8fe9f52b85b1580fe363a62c1cde2750e2b 100644 (file)
@@ -11,7 +11,7 @@ from ..obstacles import ObstacleManager
 from ..events import SceneChangeEvent
 from ..utils import debug_timer
 from ..loader import loader
-from ..transforms import Overlay, Multiply
+from ..transforms import Overlay, Multiply, Alpha
 
 from ..constants import SCREEN_SIZE, FONTS
 from ..widgets import ImageButton
@@ -101,7 +101,7 @@ class DayScene(BaseScene):
                         else:
                             self._tool = tool.name
                             if self._tool == 'seed':
-                                self._set_cursor(tool.name)
+                                self._set_cursor('seed', transform=Alpha(alpha=172))
                             elif self._tool == 'red_spotlight':
                                 self._set_cursor(
                                     'spotlight',
index b748b6e2f545e9a8745f0b869f2c09fde3ddbf4f..88f516169e02dfe46ff22523eb28a353ad421a75 100644 (file)
@@ -64,3 +64,13 @@ class Multiply(Transform):
         mult.fill(self.colour)
         surface.blit(mult, (0, 0), None, pgl.BLEND_RGBA_MULT)
         return surface
+
+
+class Alpha(Transform):
+    """ Make translucent. """
+
+    ARGS = ["alpha"]
+
+    def apply(self, surface):
+        surface.fill((255, 255, 255, self.alpha), None, pgl.BLEND_RGBA_MULT)
+        return surface