[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Rotation About A Point
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Rotation About A Point
- From: ANKUR AGGARWAL <coolankur2006@xxxxxxxxx>
- Date: Sun, 24 Apr 2011 02:53:20 +0530
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 23 Apr 2011 17:23:51 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=13FRvr91jvtF04IP7Tn+6+ZP1B7lvVxWAXfakdBUDLg=; b=K1XaTNnvRQxpiweLWqsa75um6vsemjbOkRm8FcFnAcD+AnTg3m1XliuvTGlu4uZPbI jsJ6jbhX8GcjpzfNj86MDgO2Ha0Nsh89LFaNnvI0S36/Tj9ZMBk9oQj0xSXq+K6nHYCx Ra0Zq4q8ZNLWWjzZEL8ec9HscaeNW7UKN50A8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=Bop9rXGabmMmC5mbF2N9NUxjzvMTkNyKmU56WJ0qSVvEZCIvMUJinVFf54Z7i8Rwfw hFqr354DVheZqdY0/hFhIbiIuE5NhbJGJXVpeNfY9eTV2b9CP57GRWQbyk7nfWSEJqAD T8sB+LNhDzafIITHQoAnKrCJvmTteRdOgSDhI=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hey I want to rotate the image about a point (100,100) but by using
the pygame.tranform.rotate image moves itself from the point along
with the rotation . Below is the code
import pygame
from pygame.locals import *
from sys import exit
pygame.init()
screen=pygame.display.set_mode((640,480),0,0)
pygame.display.set_caption("Rotation using transform module")
image=pygame.image.load("fugu.png").convert_alpha()
a=0
clock=pygame.time.Clock()
b=(100,100)
while True:
for i in pygame.event.get():
if i.type==QUIT:
exit()
screen.fill((0,0,0))
a=a+10
image=pygame.transform.rotate(image,a)
screen.blit(image,(100,100))
pygame.display.update()
clock.tick(1)
Whats my mistake and whats the solution???
Thanks
Ankur Aggarwal