Package pygsear :: Module Event :: Class Event
[show private | hide private]
[frames | no frames]

Class Event

object --+    
         |    
    Sprite --+
             |
            Event

Known Subclasses:
KEY_Event, MOUSEBUTTON_Event, QUIT_Event, TIMEOUT_Event

Relates Pygame Events with related actions.
Method Summary
  __init__(self, type, callback, **kwargs)
Initialize the event.
a new object with type S, a subtype of T __new__(S, ...)
  __repr__(self)
(inherited from Sprite)
  add(self, group)
Add this Event to an EventGroup.
  add_internal(self, group)
(inherited from Sprite)
  alive(self)
alive() -> bool ask the life of a sprite (inherited from Sprite)
  call(self, pygame_event, **kwargs)
Perform the callback, if enabled.
  disable(self)
Do not allow callbacks to go through.
  enable(self)
Allow callbacks to go through.
  groups(self)
groups() -> list list used sprite containers (inherited from Sprite)
  kill(self)
kill() end life of sprite, remove from all groups (inherited from Sprite)
  nop(self, ev, **kwargs)
Do nothing.
  remove(self, group)
remove(group) remove a sprite from container (inherited from Sprite)
  remove_internal(self, group)
(inherited from Sprite)
  update(self, *args)
(inherited from Sprite)

Method Details

__init__(self, type, callback=None, **kwargs)
(Constructor)

Initialize the event.
Parameters:
type - pygame.event type. Currently this includes KEYDOWN, KEYUP, MOUSEBUTTONDOWN, MOUSEBUTTONUP, and QUIT
callback - Function or method to call when the event occurs.
kwargs - Additional parameters that should be passed on to the callback.

__new__(S, ...)

Returns:
a new object with type S, a subtype of T

add(self, group)

Add this Event to an EventGroup.

call(self, pygame_event, **kwargs)

Perform the callback, if enabled.
Parameters:
pygame_event - The actual pygame.event.Event that triggered this Event.
kwargs - Additional parameters that should be passed on to the callback. Note that keyword args included here will overwrite those added at the creation of the event.

disable(self)

Do not allow callbacks to go through.

enable(self)

Allow callbacks to go through.

nop(self, ev, **kwargs)

Do nothing.

Generated by Epydoc 1.1 on Sun Jan 25 19:10:13 2004 http://epydoc.sf.net