generate functionSat, 12 Nov 2022

Open a new fullscreen window that has the text "butts" written in the center. Wait for 30 seconds, then close the window.

import pygame import time pygame.init() window = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) width, height = pygame.display.get_surface().get_size() text = "butts" font = pygame.font.SysFont("Arial", int(width / 5)) textSurface = font.render(text, True, (255, 255, 255)) rect = textSurface.get_rect() rect.center = (width / 2, height / 2) window.blit(textSurface, rect) pygame.display.update() time.sleep(30) pygame.quit()

Questions about programming?Chat with your personal AI assistant