cocoa touch - Getting CCTouch points when user clicks on an Item -
here main screen, when user clicks anywhere on screen go cctouchbegan method, far good. want when user clicks on youtube image or other image should able tell getting position , comparing cctouch values passed in cctouchbegan event. how can that?
how can position of every element on screen , compare current touching point?
you point user touched @ , check if point falls within bounding box of of buttons
the basic idea:
cocos2d::ccpoint p = ptouch->getlocation(); cocos2d::ccrect rect = this->boundingbox(); if(rect.containspoint(p)){ return true; }
Comments
Post a Comment