On Thu, Jan 15, 2009 at 5:09 PM, Hordeling <[email protected]> wrote:
>
> Thanks to Lucio, Kao, and Anthony for your previous help.
>
> Does anyone know if pyglet's on_deactivate can be intercepted by
> cocos2d layers?
>
> My goal is to Pause the game when the window becomes inactive when
> another application window is selected, for example.
>
> As a simple test, I added
>
> def on_deactivate(self):
> director.push(default_pause_scene())
> return True
>
on_deactivate works. ive just tried this:
class Test(cocos.layer.Layer):
is_event_handler = True
def on_deactivate(self, *args):
print "deactivated"
and when the layer is pushed i get the callback.
Lucio.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" 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/cocos-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---