タップ時の判定
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
//座標を取得
CGPoint location =[touch locationInView:[touch view]];
//OpenGL系の座標に変換
location =[[CCDirector sharedDirector] convertToGL:location];
//スプライトの当たり判定
if (CGRectContainsPoint(hito.boundingBox, location)) {
NSlog(@"hit!");
}
}
0 件のコメント:
コメントを投稿