Thanks, that's not quite what i want. I guess my main problem is that
the event loop is not reentrant - you can't post the same event from
within the event handler itself to be handled at the next clock tick.
On Jul 14, 7:21 pm, "Luke Miller" <[EMAIL PROTECTED]> wrote:
> I am working on a 2D adventure game engine, which as you can imagine
> uses events as part of the scripting language.
>
> I don't know if this will help you, but what I do is create my own
> EventDispatcher classes that dispatch events (this is a simplified
> version of my stuff)
>
> from pyglet import event
>
> class VidaGame(event.EventDispatcher):
> def on_my_event(self):
> print "hello world"
>
> VidaGame.register_event_type('on_my_event')
>
> Then to dispatch:
> game = VidaGame()
> game.dispatch_event("on_my_event")
>
> That sort of stuff works for me, but I also have my own partial game
> event queue so that the pyglet events can continue to be handled while
> I have my actors walking, talking and waiting.
>
> Regards,
> Luke Miller
>
> 2008/7/15 infinite8s <[EMAIL PROTECTED]>:
>
>
>
> > I would like to post events from outside of the dispatcher, but the
> > documentation of EventDispatcher says not to use dispatch_event. Also,
> > dispatch_event doesn't seem to actually dispatch the event later, but
> > instead calls it right away. Is there a way to post events to the
> > dispatcher?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---