- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint p1 = [touch locationInView:nil];
//p1.y = 480-p1.y;
CGPoint p3 = [self convertToNodeSpace:[[CCDirector sharedDirector] convertToGL:p1]];
CGRect rect = [self.play.plane boundingBox];
bool bo = CGRectContainsPoint(rect, p3);
NSLog(@"=======%i", bo);
//self.play.plane.getBody->
}
CCSprite获取点击对象
最新推荐文章于 2018-06-04 15:10:37 发布