pygame как да завъртя изображението правилно?

В pygame не мога да завъртя изображение/повърхност. Изображението се рисува правилно, просто не се върти.

self.other1 = pygame.image.load("enemy.png").convert_alpha()
self.other2 = pygame.transform.rotate(self.other1, math.radians(270))
self.screen.blit(self.other2, (0, 0))

Какво точно правя грешно?


person nobody    schedule 27.06.2011    source източник


Отговори (1)


1.- Коя версия използвате (както pygame, така и python)?

2.- Нямате нужда от радиани

3.- Трябва да посочите проблем, описанието ви изглежда двусмислено

Както и да е, оставям пример тук. Късмет.

import pygame
from pygame.locals import *

SIZE = 640, 480
pygame.init()
screen = pygame.display.set_mode(SIZE)

done = False
screen.fill((0, 0, 0))
other1 = pygame.image.load("enemy.png").convert_alpha()
other2 = pygame.transform.rotate(other1, 270)
screen.blit(other2, (0, 0))
pygame.display.flip()

while not done:
    for e in pygame.event.get():
        if e.type == QUIT or (e.type == KEYDOWN and e.key == K_ESCAPE):
            done = True
            break    
person razpeitia    schedule 27.06.2011