def print_exit_message(self, text_color, background_color, screen): font = pygame.font.Font(None, self.ctx.font_size) display_info = pygame.display.Info() screen_width = display_info.current_w screen_height = display_info.current_h rect = pygame.Rect((0, screen_height - 30, screen_width, 30)) rendered_text = render_textrect("Press %s to QUIT" % self.ctx.exit_key, font, rect, text_color, background_color, 1) if rendered_text: screen.blit(rendered_text, rect.topleft)
def print_message(self, message, text_color, background_color, screen): if pygame.font: font = pygame.font.Font(None, self.ctx.font_size) display_info = pygame.display.Info() screen_width = display_info.current_w screen_height = display_info.current_h rect = pygame.Rect((0, LOGO_HEIGHT + MESSAGE_OFFSET_VERT, screen_width, screen_height - LOGO_HEIGHT - MESSAGE_OFFSET_VERT)) rendered_text = render_textrect(message, font, rect, text_color, background_color, 1) if rendered_text: screen.blit(rendered_text, rect.topleft)