示例#1
0
文件: messages.py 项目: Sveder/Pypes
 def __init__(self, first_line, second_line, options):
     self.options = options
     self.first_line = first_line
     self.second_line = second_line
     self.font_size = int(self.options["font_size"])
     try:
         self.font = pygame.font.Font(data.filepath(self.options["font"]), self.font_size)
     except IOError:
         self.font = pygame.font.SysFont(pygame.font.get_default_font(), self.font_size)
     
     self.rect = main.ini_list_to_rect(self.options["rect"])
     self.surface = pygame.Surface((self.rect.width, self.rect.height))
     #self.surface = pygame.image.load(data.filepath(self.options["image"])).convert()
     self.surface.set_colorkey(COLORS["black"])
     
     for index, letter in enumerate(first_line):
         self.draw_letter(index, letter, 0)
     
     for index, letter in enumerate(second_line):
         self.draw_letter(index, letter, 1)