Fernando Videla

Generation

generate functionFri, 17 Mar 2023

como agregar tamaño y color gradiente a los menu

def add_menu_item(menu_item, r ,g ,b): pygame.draw.rect(screen, (r, g, b), [0, height, width/3, height*len(menu_item)]) font = pygame.font.SysFont('Arial', 40, True) text = font.render(menu_item, True, (255, 255, 255)) textRect = text.get_rect() textRect.center = (width/3/2, height*len(menu_item)/2) screen.blit(text, textRect) return height*len(menu_item)

Questions about programming?Chat with your personal AI assistant