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

Class TIMEOUT_Event

object --+        
         |        
    Sprite --+    
             |    
         Event --+
                 |
                TIMEOUT_Event


Method Summary
  __init__(self, delay, count, callback, keepalive, **kwargs)
Initialize a TIMEOUT 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. (inherited from Event)
  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)
Make the Event callback, then either count down calls or disable.
  disable(self)
Do not allow callbacks to go through. (inherited from Event)
  enable(self)
Allow callbacks to go through. (inherited from Event)
  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. (inherited from Event)
  remove(self, group)
remove(group) remove a sprite from container (inherited from Sprite)
  remove_internal(self, group)
(inherited from Sprite)
  reset(self)
Reset the Event to its initial state.
  set_count(self, count)
  tick(self, ticks)
Count down ticks until time to call.
  update(self, *args)
(inherited from Sprite)

Method Details

__init__(self, delay, count=1, callback=None, keepalive=False, **kwargs)
(Constructor)

Initialize a TIMEOUT Event

Note that using a TIMEOUT_Event can conflict with too low a setting of conf.MAX_TICKS causing events to fire "too soon" on overloaded systems. (BUT this should be fixed now...)
Parameters:
delay - Time in milliseconds before firing the callback.
count - Number of times to repeat the event. A count of -1 indicates that the event should repeat forever.
callback - Function or method to call when the event occurs.
keepalive - If True, do not kill the event when calling.
kwargs - Additional parameters that should be passed on to the callback.

__new__(S, ...)

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

call(self, pygame_event, **kwargs)

Make the Event callback, then either count down calls or disable.

If the count on this Event reaches 0, it will be Event.disabled. If keepalive is False it will also be pygame.sprite.Sprite.killed. Note that this means it will have to be added to your EventGroup again if you want to re-use the Event. This was done to avoid ending up with many disabled events in the event group.
Parameters:
pygame_event - Pygame event making the call. NOT USED If called from tick. Instead it will be passed None.
kwargs - Additional parameters that should be passed on to the callback.

reset(self)

Reset the Event to its initial state.

tick(self, ticks)

Count down ticks until time to call.
Parameters:
ticks - Number of ticks since last checked.

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