I've just happen to notice that line 55 of scene.py, the third line of
this test inside the EventHandlerMixin class:
if ( scene._handlers_enabled and
scene.is_running and
isinstance(child, cocos.layer.Layer) <-----
):
is there just to enforce that only Layer and it's subclasses can
handle events. This is probably by design, but is it really a good
thing?
Some context: I was making a HandleNode class that would be used to
manipulate others nodes and my first intention was to make it handle
mouse events by itself. Since manipulated nodes are mainly sprites and
HandleNode is set as child to the note it manipulates it wouldn't make
much sense to make it a Layer.
Maybe my approach is wrong from some point of view, but even if that's
true the idea of any CocosNode subclass (that also inherits from
EventHandlerMixin, of course) being able to handle events still
appeals to me.
--
Kao Cardoso Félix
Página pessoal: http://www.inf.ufrgs.br/~kcfelix
Blog: http://kaofelix.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---