def draw_unselected_tab(self, rect): DEFAULT_COLOR = transparency(DARKER_MAGENTA, 0.5) border = 2 internal_rect = pygame.Rect((rect.left + border, rect.top + border), (rect.w - 2 * border, rect.h - border)) surface = pygame.Surface((rect.width, rect.height), SRCALPHA, 32) pygame.draw.rect(surface, DEFAULT_COLOR, internal_rect) return Image(surface)
def draw_selected_tab(self, rect): DEFAULT_COLOR = transparency(PURPLE, 0.5) surfaces = [] for i in xrange(2): border = 2 + i top_left = (rect.top + border, rect.left + border) width_height = (rect.w - 2 * border, rect.h - border) internal_rect = pygame.Rect(top_left, width_height) surface = pygame.Surface((rect.width, rect.height), SRCALPHA, 32) pygame.draw.rect(surface, DEFAULT_COLOR, internal_rect) surfaces.append(surface) return AnimatedImage(surfaces, 10)
class DialogConfig(Config): """ The DialogConfig contains attributes related to dialog rendering. :attr:`font_name` Name of the font or font file to be used in dialogs. :attr:`font_size` Size to render the font in dialogs. :attr:`border_width` Space in pixels between the screen edge and the text box and between the text box and the text. :attr:`line_spacing` Space in pixels between text lines. :attr:`choice_line_spacing` Space in pixels between choice text lines. :attr:`bg_color` Tuple with the dialog's background colors. :attr:`font_color` Tuple with the text font's color. :attr:`selected_font_color` Tuple with the text color to use for selected options in a ChoiceDialog. :attr:`not_selected_font_color` Tuple with the text color to use for options not selected in a ChoiceDialog. """ font_name = 'Verdana' font_size = 12 border_width = 15 line_spacing = 2 choice_line_spacing = 2 bg_color = transparency(PURPLE, 0.5) font_color = WHITE selected_font_color = RED not_selected_font_color = GREY
def draw_scroll_area(self, rect): DEFAULT_COLOR = transparency(DARK_RED, 0.5) surface = pygame.Surface((rect.width, rect.height), SRCALPHA, 32) pygame.draw.rect(surface, DEFAULT_COLOR, rect) return Image(surface)
def draw_panel(self, rect): DEFAULT_COLOR = transparency(PURPLE, 0.5) surface = pygame.Surface((rect.width, rect.height), SRCALPHA, 32) pygame.draw.rect(surface, DEFAULT_COLOR, rect) return Image(surface)