[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Making a clock rotate



Pete Shinners wrote:

def blit_centered(src, dst):
r = src.get_rect()
r.center = dst.get_rect().center
return dst.blit(src, r)

you can use this function to blit any source image to any destination image and have the two centers shared.
Thanks for your help, and thanks to Robert too, but I think I didn't explain very well my needs.
self.image is the pointer of the clock and it is an image with 128 height and 3 width. It is half as tall as the surface and very thin.
My center is not the center of the rectangle but it's 128,128 (the center of the surface). I need to have that center for every tick the clock
does.

I also must use rotozoom because with rotate I can get nothing to actually rotate...
Maybe a solution could be to use alpha blending and make another 256,256 with a white pointer pictured in it, and everything else is transparent.
Then the rotation center would really be the center of the image...
I can try.

thx

--
try: troll.uses(Brain)
except TypeError, data: troll.plonk()
Co-Responsabile Hardware Information & Technology http://hit.edengames.net