示例#1
0
    def _create_option_images(self):
        "Genera todos los items del menú."
        line_step = 0

        for (text, callback) in self.options:
            img_normal, img_normal_size = utils.render_text(text, self.normal_font, 
                    self.normal_color)
            img_selected, img_selected_size = utils.render_text(text, 
                    self.selected_font, self.selected_color)
            
            self.imgs_normal.append(img_normal)
            self.imgs_selected.append(img_selected)
            
            line_step = max(max(img_normal_size[3], img_selected_size[3]), line_step)
        
        self.line_step = line_step
示例#2
0
 def update_image(self):
     font = utils.load_font("FreeSans.ttf", 30)
     text = "Lines: %d" % (self.lines)
     self.image, self.image_rect = utils.render_text(text, font)
     self.image_rect.move_ip(
         self.rect.x + ((self.rect.w - self.image_rect.w) / 2),
         self.rect.y + 10)
示例#3
0
    def _create_option_images(self):
        "Genera todos los items del menú."
        line_step = 0

        for (text, callback) in self.options:
            img_normal, img_normal_size = utils.render_text(
                text, self.normal_font, self.normal_color)
            img_selected, img_selected_size = utils.render_text(
                text, self.selected_font, self.selected_color)

            self.imgs_normal.append(img_normal)
            self.imgs_selected.append(img_selected)

            line_step = max(max(img_normal_size[3], img_selected_size[3]),
                            line_step)

        self.line_step = line_step
示例#4
0
    def render_authors(self, names):
        rendered_authors = []

        for author in names:
            rendered_text = utils.render_text(author, self.font)[0]
            rendered_authors.append(rendered_text)

        return rendered_authors
示例#5
0
 def update_image(self):
     font = utils.load_font("FreeSans.ttf", 30)
     text = "Lines: %d" % (self.lines)
     self.image, self.image_rect = utils.render_text(text, font)
     self.image_rect.move_ip(self.rect.x + ((self.rect.w - self.image_rect.w) / 2), self.rect.y + 10)
示例#6
0
 def __init__(self, director):
     scene.Scene.__init__(self, director)
     self.font = utils.load_font("FreeSans.ttf", 30)
     self.message, rect = utils.render_text("Una linea\nDos\nTres",
                                            self.font)
示例#7
0
 def create_return_message(self):
     font = utils.load_font("FreeSans.ttf", 14)
     text = "Pulse ESC para regresar al menu"
     self.return_message, rect = utils.render_text(text, font)
示例#8
0
 def show_message(self, text):
     font = utils.load_font("FreeSans.ttf", 14)
     self.current_message, self.current_message_rect = utils.render_text(text, font)
示例#9
0
 def __init__(self, director):
     scene.Scene.__init__(self, director)
     self.font = utils.load_font("FreeSans.ttf", 30)
     self.message, rect = utils.render_text("Una linea\nDos\nTres", self.font)
示例#10
0
 def create_return_message(self):
     font = utils.load_font("FreeSans.ttf", 14)
     text = "Pulse ESC para regresar al menu"
     self.return_message, rect = utils.render_text(text, font)
示例#11
0
 def show_message(self, text):
     font = utils.load_font("FreeSans.ttf", 14)
     self.current_message, self.current_message_rect = utils.render_text(
         text, font)