On Tue, Feb 28, 2012 at 5:33 PM, Philippe <[email protected]> wrote:

> I would be more in a case with several levels, so, a scene per level.
>
> here is a code
> http://pastebin.com/kc4PLGC0
>
> If I click, the event will be receive by layer1 and my first sprite.
> I get the following output
>
> [Layer1] on_mouse_press
> [MySprite] on_mouse_press 1
>
> then, it replaces the scene.
> if I click again, I get
>
> [Layer2] on_mouse_press
> [MySprite] on_mouse_press 2
> [MySprite] on_mouse_press 1
>
> The event it still handled by the sprite from scene1. layer1 behave
> well. Only issue with the sprite.
>
>
I see the same.

1. I think that while not clearly stated in the docs the event handling
nodes should be Layers or Scenes:
    CocosNode class has no event functionality
    Scene and Layer inherits from scene.EventHandlingMixin

2. event handling code in cocos is under-designed under-coded; they are
others issues related (see
http://code.google.com/p/los-cocos/issues/detail?id=163 )

3. I'm in a hurry now but I will be glad to discuss what will be a sane
event handling for cocos.

By the way, I always post the samples (if too long) to pastebin, is it
> find ? do people prefer that we post everything in the message ?
>
>
>


 pastebins are fine

claudio

--

-- 
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.

Reply via email to