[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] right click and other stuff
How can I manage right click in Pygame?
Use events:
http://pygame.org/docs/ref/pygame_event.html
Specifically. First you need to get the next event, then if it
is a MOUSEBUTTONDOWN or MOUSEBUTTONUP you can check which
button it was that was pressed or released.
import pygame
from pygame.locals import *
pygame.init()
pygame.display.set_mode((640,480))
while 1:
for e in pygame.event.get():
if e.type == MOUSEBUTTONDOWN:
if e.button == 3:
print 'right'
You can also query the mouse state directly:
http://pygame.org/docs/ref/pygame_mouse.html
How can I create a scroller for my map??Anyone has a tutorial, an example
or something else?? I need a scrolling background that scrolls following
the position of a sprite: so if it's going left, the map scrolls left, if
it's going right tme map scrolls right and so on...
A very nice example:
http://aspn.activestate.com/ASPN/Mail/Message/1446979
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org