예제 #1
0
 def minimap(self, filename):
     gamemap = GameMap(load_yaml('maps', filename))
     name = gamemap.name()
     surface = pygame.Surface((128,128))
     for x in range(0,20):
         for y in range(0,20):
             tilepath = gamemap.tile(x,y).background()
             if tilepath:
                 tileimage = self.frontend.tilemaps.get_by_path(tilepath)
                 tileimage = pygame.transform.smoothscale(tileimage, (6,6))
             else:
                 tileimage = pygame.Surface((6,6))
                 tileimage.fill((0,0,0))
             surface.blit(tileimage,(x*6, y*6))
     text = render_text(name, size=20, color=(0,0,0), font=pygame.font.Font(None,20))
     textrect = text.get_rect()
     textblock = pygame.Surface((textrect.w, textrect.h))
     textblock.fill((255,255,255))
     textblock.blit(text, (0,0))
     surface.blit(textblock, (0,60))
     return (surface, filename)