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

Re: [pygame] Making a clock rotate



dialtone wrote:
self.quadrante = rotate_with_axis(self.quadrante, self.second_degree, \
self.axis)
self.quadrante.blit(self.quadrante, self.quadrante.get_rect())
heya dialtone, i saw this post on the python mailing list. i sent you a reply i think, but maybe it didn't get through. these two lines are your problem.

at the beginning you set self.quadrante to the display surface. but here you assign self.quadrante to an offscreen rotated surface. now no matter what you do to self.quadrante, it will not effect the display. you need to change these two lines into this.

self.image = rotate_with_axis(self.image, ...)
self.quadrante.blit(self.image, (0, 0))

btw, the get_rect() for a surface always returns a rectangle with the topleft corner at 0, 0 and width,height set to the dimensions of the image. so on our last line you can see we shortcut the get_rect()


--
"if they keep silent, the very stones will cry out"
pete*shinners.org