Ignore:
Timestamp:
09/06/13 18:12:07 (8 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Phase:
public
Rebase:
34313438353234386265653530386664656564353733623661353035316431333963333965623435
Message:

Transparent moonlight

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/render.py

    r353 r362  
    194194       Outline is assumed to be in pymunk coordinates"""
    195195
    196     def __init__(self, outline, tile_image):
     196    def __init__(self, outline, tile_image, alpha=255):
    197197        self._tile_image = tile_image
    198198        self.outline = outline
    199199        self._tiled = None
    200200        self._offset = None
     201        self._alpha = alpha
    201202
    202203    def _make_surface(self, surface):
     
    207208            pointlist = [pymunk.pygame_util.to_pygame(p, surface)
    208209                         for p in self.outline]
    209             rect = pygame.draw.polygon(mask, pygame.color.THECOLORS['white'],
     210            rect = pygame.draw.polygon(mask,
     211                                       pygame.color.Color(
     212                                           255, 255, 255, self._alpha),
    210213                                       pointlist, 0)
    211214            self._offset = (rect.x, rect.y)
Note: See TracChangeset for help on using the changeset viewer.