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()
y=0
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,(180, 0, 0))
screen.blit(text1, (10,y))
pygame.display.flip()
y = y + 1
clock.tick(60)
pygame.quit()
|