cocoa touch - Getting CCTouch points when user clicks on an Item -


main screen

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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -