On Wed, Feb 29, 2012 at 4:44 PM, Philippe <[email protected]> wrote:
> > Thats > ... > I will rewrite a bit my stuff with more Layers. > Is there a cost, in term of permormance for switching 20 sprites to 20 > layers ? > > For the drawing point of view would be negligible. But looks as a bit of code bloat. If you are are trying to provide mouse click detection, probably an approach like the one in samples\mouse_elastic_box_selection.py can be better suited. > > It can be reasonable that the reactions to IO will be handled by the > object > > controlled by the human player, but that not necessarily means that > Sprite > > must catch the event. > > ... > I understand your view. It's also link to how cocos propagates events > (back to front). > Don't count on that, despite what the documentation tells. With the current code you are sure that child handlers are tried first, but thats all. > I was use to do it the other way before (front to back). then, > catching event in the front sprites was nice. > I will try to follow cocos philosophy ! > But the result is a long on_mouse_press() function. needs to check a > lot of self.contains > > > If you replace in your script the line > > director.window.pop_handlers() > > with > > director.window.remove_handlers(self) > > the double call does not happen, but I don't know if something else will > > broke.( Feel free to try and report :) ) > I tried it in my sample. > switching from one scene to other again and again. > the event was correctly handled always. > http://pastebin.com/FE7VxcPK > > > by the way, how can I help improving cocos2D ? > > Multiple ways: > > ... > I will try to post something about using one .svg for all the assets. > Or communication between 2 cocos application. > > > -- 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.
