Re: [pygame] Mouse Focus

2011-05-09 Thread ANKUR AGGARWAL
It worked :D:D Thanks a lot :):) Ankur Aggarwal On Mon, May 9, 2011 at 1:49 PM, Scribble Master wrote: > Use the rect of each text surface. Then you can get the mouse position with > pygame.mouse.getpos() > http://www.pygame.org/docs/ref/mouse.html#pygame.mouse.get_pos > > and check if the mouse'

Re: [pygame] Mouse Focus

2011-05-09 Thread Scribble Master
Use the rect of each text surface. Then you can get the mouse position with pygame.mouse.getpos() http://www.pygame.org/docs/ref/mouse.html#pygame.mouse.get_pos and check if the mouse's position is in that rect using Rect.collidepoint(): http://www.pygame.org/docs/ref/rect.html#Rect.collidepoint

[pygame] Mouse Focus

2011-05-08 Thread ANKUR AGGARWAL
I am getting some trouble with the mouse focus too. I have render the text on the screen like- level1 level2 level3 I want an algo that when i click on level1 , it executes the level1 . I am unable to focus on the text too . Please give me an algo for it Thanks in Advance Ankur Aggarwal