def make_image(self): self.surface = self.font.render(self.text, self.font_aa, self.font_color) if self.bg_image and not self.bg_image == "noimage": new = image.resize_tile(self.bg_image, self.surface.get_size()) a = self.surface new.blit(a, (int(careful_div(new.get_width() - a.get_width(), 2)), int(careful_div(new.get_height() - a.get_height(), 2)))) self.surface = new self.make_rect() self.move()
def make_image(self): self.surf_regular = self.font.render(self.text, self.font_aa, self.font_color_regular) if self.bg_regular and not self.bg_regular == "noimage": new = image.resize_tile(self.bg_regular, self.surf_regular.get_size()) a = self.surf_regular new.blit(a, (int(careful_div(new.get_width() - a.get_width(), 2)), int(careful_div(new.get_height() - a.get_height(), 2)))) self.surf_regular = new self.surf_hover = self.font.render(self.text, self.font_aa, self.font_color_hover) if self.bg_hover and not self.bg_hover == "noimage": new = image.resize_tile(self.bg_hover, self.surf_hover.get_size()) a = self.surf_hover new.blit(a, (int(careful_div(new.get_width() - a.get_width(), 2)), int(careful_div(new.get_height() - a.get_height(), 2)))) self.surf_hover = new self.surf_click = self.font.render(self.text, self.font_aa, self.font_color_click) if self.bg_click and not self.bg_click == "noimage": new = image.resize_tile(self.bg_click , self.surf_click .get_size()) a = self.surf_click new.blit(a, (int(careful_div(new.get_width() - a.get_width(), 2)), int(careful_div(new.get_height() - a.get_height(), 2)))) self.surf_click = new self.surface = self.surf_regular self.make_rect() self.move()