Thanks Claudio! As always, with the clear and best answer! Cheers! J
On 20 October 2012 00:46, <[email protected]> wrote: > Today's Topic Summary > > Group: http://groups.google.com/group/cocos-discuss/topics > > - Esc popping out a scene <#13a7d22cdd257d16_group_thread_0> [2 > Updates] > > Esc popping out a > scene<http://groups.google.com/group/cocos-discuss/t/3ddfa6086dd80998> > > Jason <[email protected]> Oct 19 01:11PM -0700 > > I'm working a game that pushes scenes onto the stack. So you are going > from > one level to the next. At a certain point, the game will bring the > player > back through these levels. > > However, when you press ESC, it pops the current scene out of the > stack, > and starts running the previous one. Is there any way for me to stop > that? > > Cheers, > J > > > > > claudio canepa <[email protected]> Oct 19 05:48PM -0300 > > > > Cheers, > > J > > -- > > Yes. > Most surely you have an on_key_press handler in your scene (be it > directly > in the scene or in a layer added to the scene) > what you want is add in that handler > > if symbol == key.ESCAPE: > return True > > The return True tells the event dispatcher that the event has been > handled > and to please do not pass to other handlers. Perfect, the ESC will not > reach the code in cocos.director.DefaultHandler, the responsible to > call > director pop when it sees an ESC. > > > > You received this message because you are subscribed to the Google Group > cocos-discuss. > You can post via email <[email protected]>. > To unsubscribe from this group, > send<[email protected]>an empty message. > For more options, > visit<http://groups.google.com/group/cocos-discuss/topics>this group. > > -- > 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. > -- 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.
