def __init__(self, screen_size, text=None, color=None, font_size=None): if font_size is None: font_size = 24 box_height = font_size * 2 + 48 box_width = len(text) * font_size + 20 + 48 box_bounds = pygame.Rect(screen_size[0] / 2 - box_width / 2, screen_size[1] / 2 - box_height / 2, box_width, box_height) Box.__init__(self, box_bounds=box_bounds, color=color, font_size=font_size) self.text = text Box.open(self, color=color)
def open(self, text=None, portrait=None, color=None, choice=None, background=None): if text: self.text = text if portrait: self.portrait = self.get_image(portrait) if choice: self.choice = choice if background: self.background = self.get_image(background) Box.open(self, color)
def open(self, color=None): Box.open(self, color)