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
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)
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
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
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)
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)
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)
def show_message(self, text): font = utils.load_font("FreeSans.ttf", 14) self.current_message, self.current_message_rect = utils.render_text(text, font)
def show_message(self, text): font = utils.load_font("FreeSans.ttf", 14) self.current_message, self.current_message_rect = utils.render_text( text, font)