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

Re: [pygame] how to get point where is an image ...





On 10/11/05, Peter Shinners <pete@xxxxxxxxxxxx> wrote:
On Tue, 2005-10-11 at 01:17 -0300, Juan Reyes López wrote:
>  player = pygame.image.load('player.jpg').convert()
>  .....
>   I move player to other point, the initial point was (0,0) how I can
> get new (x,y) where player is drawed?

I'm not sure what is wrong. When you call Surface.blit() it returns a
rectangle that covers where the player was drawn.

player = pygame.image.load('player.jpg').convert()
position = [10, 10]
drawed = screen.blit(player, position)




 the problem is that I am doing a "drag & drop" so the position  is changed to  the mouse position when the button 1 is pressed, so I just want to know if there is some "magic" function that returns the point where is the player o I have do it by my self ..