[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] [Pygame] Joystick Inputs



On Wed, Dec 7, 2011 at 8:25 PM, Andrew Godfroy <killerrin@xxxxxxxxxxx> wrote:
Alright, Thank you for explaining it to me :) Now that I know whats happening I think I found a Solution. inside if my __init__ I added an extra variable “self.oldimage = self.image” Then inside of the rotateimage call, I have it set to: “self.image = pygame.transform.rotate (self.oldimage, -angle_degrees)”  This way, it will call up the oldimage, and save to the new surface.
Yes.  This is a valid solution.  

Except in the trivial case, the rotated image will still be a different size, of course.  Remember to offset the image correctly (I recommend calling .get_width() and .get_height()) and then subtracting half that from your player's position to get draw coordinates.