Re: [pygame] Pygame Problem Solving 1

2007-09-14 Thread Lamonte Harris
ah really, I'll look at that sometime today :). On 9/13/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > > Lamonte Harris wrote: > > Whups major flaw forgot to check if the height also. > > Check out the collidepoint() method of the Rect class. > It'll check both coordinates for you in one go. > > -- >

Re: [pygame] Pygame Problem Solving 1

2007-09-13 Thread Greg Ewing
Lamonte Harris wrote: Whups major flaw forgot to check if the height also. Check out the collidepoint() method of the Rect class. It'll check both coordinates for you in one go. -- Greg Ewing, Computer Science Dept, +--+ University of Canterbury, |

Re: [pygame] Pygame Problem Solving 1

2007-09-13 Thread Greg Ewing
Lamonte(Scheols/Demonic) wrote: elif event.type == pygame.MOUSEBUTTONDOWN: ... mouse = pygame.mouse.get_pos() It's better to get the mouse position from the event, seeing as you've got one, than to use mouse.get_pos(). Then you can be sure

Re: [pygame] Pygame Problem Solving 1

2007-09-13 Thread Greg Ewing
Lamonte Harris wrote: So I was thinking if I made an invisible rect that moved when the mouse moved then I left clicked and it would get the current surface position of the rect, then it would run a function to see if that current position matches any of the map squares at the bottom of the scr

Re: [pygame] Pygame Problem Solving 1

2007-09-13 Thread Luke Paireepinart
Lamonte Harris wrote: elif event.type == pygame.MOUSEBUTTONDOWN: print pygame.mouse.get_pos() + (25,25) As DR0ID said, you should be able to get the mouse position from the event. print MAP.blocks[2].point mouse = pygam

Re: [pygame] Pygame Problem Solving 1

2007-09-13 Thread Lamonte Harris
elif event.type == pygame.MOUSEBUTTONDOWN: print pygame.mouse.get_pos() + (25,25) print MAP.blocks[2].point mouse = pygame.mouse.get_pos() rng = mouse[0] - MAP.blocks[2].point[0] rng2

Re: [pygame] Pygame Problem Solving 1

2007-09-13 Thread Lamonte Harris
Whups major flaw forgot to check if the height also. On 9/13/07, Lamonte(Scheols/Demonic) <[EMAIL PROTECTED]> wrote: > > I'm sort of doing it a big differently, right now I'm just testing, but I > can tell if my mouse position is in the second square block like so: > > elif event.t

Re: [pygame] Pygame Problem Solving 1

2007-09-13 Thread Lamonte(Scheols/Demonic)
I'm sort of doing it a big differently, right now I'm just testing, but I can tell if my mouse position is in the second square block like so: elif event.type == pygame.MOUSEBUTTONDOWN: print pygame.mouse.get_pos() + (25,25) print MAP.blocks[

Re: [pygame] Pygame Problem Solving 1

2007-09-12 Thread DR0ID
Hi as you can see from the documentation, the mouse event provides you the position: MOUSEMOTION pos, rel, buttons MOUSEBUTTONUPpos, button MOUSEBUTTONDOWN pos, button so no need to use pygame.mouse.get_position() (well it another way to get it, perhaps if you dont have ev

Re: [pygame] Pygame Problem Solving 1

2007-09-12 Thread Luke Paireepinart
Lamonte Harris wrote: Problem Solving 1 Rendering a map switching script. There will be a simple window. At the bottom if tge screen it will say pick a map. Using the mouse events and positioning I will be able to click on the squares that will represent certain maps at the bottom

[pygame] Pygame Problem Solving 1

2007-09-12 Thread Lamonte Harris
Problem Solving 1 Rendering a map switching script. There will be a simple window. At the bottom if tge screen it will say pick a map. Using the mouse events and positioning I will be able to click on the squares that will represent certain maps at the bottom of the screen and the diffe