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
| ``call`(self, pygame_event, **kwargs)` Make the Event callback, then either count down calls or disable.
| ``reset`(self)` Reset the Event to its initial state.
| `set_count(self, count)`
| ``tick`(self, ticks)` Count down ticks until time to call.
Inherited from Event
| ``add`(self, group)` Add this `Event` to an `EventGroup`.
| ``disable`(self)` Do not allow callbacks to go through.
| ``enable`(self)` Allow callbacks to go through.
| ``nop`(self, ev, **kwargs)` Do nothing.
Inherited from Sprite
| ``__repr__`(self)`
| ``add_internal`(self, group)`
| ``alive`(self)` alive() -> bool check to see if the sprite is in any groups
| ``groups`(self)` groups() -> list of groups list used sprite containers
| ``kill`(self)` kill() remove this sprite from all groups
| ``remove`(self, *groups)` remove(group or list of groups, ...) remove a sprite from container
| ``remove_internal`(self, group)`
| ``update`(self, *args)`
Inherited from object
| ``__delattr__`(...)` x.__delattr__('name') <==> del x.name
| ``__getattribute__`(...)` x.__getattribute__('name') <==> x.name
| ``__hash__`(x)` x.__hash__() <==> hash(x)
| ``__reduce__`(...)` helper for pickle
| ``__reduce_ex__`(...)` helper for pickle
| ``__setattr__`(...)` x.__setattr__('name', value) <==> x.name = value
| ``__str__`(x)` x.__str__() <==> str(x)
Inherited from type
| ``__new__`(T, S, ...)` T.__new__(S, ...) -> a new object with type S, a subtype of T

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 `call`ing. `kwargs` - Additional parameters that should be passed on to the callback. Overrides: `pygsear.Event.Event.__init__`

### 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.disable`d. If `keepalive` is `False` it will also be `pygame.sprite.Sprite.kill`ed. 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. Overrides: `pygsear.Event.Event.call`

### 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 2.0 on Fri Nov 11 14:26:38 2005 | http://epydoc.sf.net