import pygame
import random
import math
WIDTH = 500
HEIGHT = 500
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
running = True
clock = pygame.time.Clock()
r=180
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
pygame.image.save(screen, "image.jpg")
screen.fill((255,255,255))
f1 = pygame.font.Font(None, 50)
text1 = f1.render('Привет', True,(r, 0, 0))
screen.blit(text1, (100,250))
pygame.display.flip()
if r > 0:
r = r - 1
clock.tick(60)
pygame.quit()
|