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
If it is, execute the function for that level.
Good luck!On Mon, May 9, 2011 at 2:43 AM, ANKUR AGGARWAL <coolankur2006@xxxxxxxxx> wrote:
I am getting some trouble with the mouse focus too.I have render the text on the screen like-level1level2level3I 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 itThanks in AdvanceAnkur Aggarwal