c++ - Cocos2d-x How do i enable / disable ccTouchMoved events? -
i have ccsprite received cctouchmoved event , can dragged on screen want enable user to:
1. move 5 or 10 pixels cctouchmoved
2. cctouchmoved event disabled means user couldn't drag it
3. animation x or y direction depending drag direction continue 100 pixels ccmoveby action
4. when animation done enable cctouch events
the important me how enable / disable cctouch events
p.s
not give me code question , need know command use thanks
you can go remove touch delegate (i,e object takes touches)
ccdirector::shareddirector()->gettouchdispatcher()->removedelegate(yourobject);
else, better use boolean variable inside class. check before processing touches inside delegate methods.
Comments
Post a Comment