cocos2d android - How to Detect the CCSprite Touchevent getBoundingbox equals of CCTouches -
i new cocos2d. using ccsprite animation button. struggle detect cctouches , ccsprite getbounding box equals click event.
from way can achieve need , write code in cctouches___() :
arraylist<ccsprite> animation= new arraylist<ccsprite>(); cgpoint location = ccdirector.shareddirector().converttogl(cgpoint.ccp(event.getx(), event.gety())); (ccsprite target : animation){ if(cgrect.containspoint((target.getboundingbox()), location)){ //here want }
Comments
Post a Comment