sourcemars / cocos2d-android-1

Automatically exported from code.google.com/p/cocos2d-android-1
0 stars 0 forks source link

How can i override ccTouchbegan in cocos2d-android #126

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have a set of sprite lists.i want to remove the topmost lying sprite if the 
sprites overlap.

   if ( popRect1.containsPoint( popRect1, location ) )
                    {

                            BaloonList1.remove( baloons );
                            baloons.removeSelf();

                      }

   if ( popRect2.containsPoint( popRect2, location ) )
                    {

                            BaloonList2.remove( baloons );
                            baloons.removeSelf();

                      }             

When two sprites of same list overlap and if i touch them only the topmost 
sprite will be removed...if 2 sprites are from different list and when i touch 
the topmost sprite both of them are removing(Like my touch is intercepting..I 
think its happening because both the touch points are with the  bounded 
rectangles of the sprites)..I searched alot.Some say  override 
TouchBegan..registerWithTouchDispatcher...DOes any one have any idea ??????? i 
know this could be a easy question..But its aint for a 2 month old android 
newbie :( :( some body plzz help   

Original issue reported on code.google.com by vimek...@gmail.com on 2 Jul 2012 at 2:45