[英]how can i rotate an image in pygame with out current command(with out *pygame.transform.rotate* command)?
import pygame
SIZE = 1000, 900
pygame.init()
screen = pygame.display.set_mode(SIZE)
a=0
done = False
screen.fill((0, 0, 0))
other1 = pygame.image.load("image.jpg")
screen.blit(other1, (0, 0))
while not done:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_LEFT:
a=a+90
other2 = pygame.transform.rotate(other1, a)
screen.blit(other2, (0, 0))
if event.key == pygame.K_RIGHT:
a=a-90
other2 = pygame.transform.rotate(other1, a)
screen.blit(other2, (0, 0))
screen.fill((0,0,0))
pygame.display.flip()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.