Mercurial > nagslang
comparison nagslang/utils.py @ 387:ca89d566f9ef
Drop unused alpha bit from tile_surface helper
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sat, 07 Sep 2013 00:10:20 +0200 |
parents | d0aeb893967d |
children | ae8eb7c0f7bb |
comparison
equal
deleted
inserted
replaced
386:6daf48763bc0 | 387:ca89d566f9ef |
---|---|
26 if vec.length != 0: | 26 if vec.length != 0: |
27 vec.length = length | 27 vec.length = length |
28 return vec | 28 return vec |
29 | 29 |
30 | 30 |
31 def tile_surface(size, tile_image, alpha=255): | 31 def tile_surface(size, tile_image): |
32 # create a surface, approriately tiled | 32 # create a surface, approriately tiled |
33 surface = pygame.surface.Surface(size, pgl.SRCALPHA) | 33 surface = pygame.surface.Surface(size, pgl.SRCALPHA) |
34 surface.fill(pygame.color.Color(0, 0, 0, alpha)) | |
35 x_step = tile_image.get_rect().width | 34 x_step = tile_image.get_rect().width |
36 y_step = tile_image.get_rect().height | 35 y_step = tile_image.get_rect().height |
37 x_count = size[0] // x_step + 1 | 36 x_count = size[0] // x_step + 1 |
38 y_count = size[1] / y_step + 1 | 37 y_count = size[1] / y_step + 1 |
39 tile_rect = pygame.rect.Rect(0, 0, x_step, y_step) | 38 tile_rect = pygame.rect.Rect(0, 0, x_step, y_step) |