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.
>
> --
>
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, |
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
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
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
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
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
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[
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
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
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
11 matches
Mail list logo