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

[pygame] Error with image.get_rect()



Hi there!
I have a little problem with that function image.get_rect() and that is that after loading an image, I try to obtain its rect but it does nothing...

in my code I do this:
def __init__ (pygame.sprite.Sprite):
	...
	self.counterArea=pygame.Rect(0,0,0,0)
	...

....
def loadCounter(self):
	...
	self.counterImage= pygame.image.load("....")

	self.counterImage= self.counterImage.convert()

	self.counterArea= self.counterImage.get_rect()
	...

and when I do :

print "Top: ", self.counterArea.top
>>>0

Does anyone have any idea of where do my code fails? I have look for examples and info, but all I see seems to say I'm right, so what's wrong?

Thanks so much.
Regards..
Marta.