これは私のccTouchesMovedメソッドです。 何が間違っていますか?私はcocos2dフレームワークを使用します。マルチタッチがcocos2dで動作しない
-(void) ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
CCNode *sprite = [self getChildByTag:kTagPlayer];
CCNode *sprite2 = [self getChildByTag:kTagEnemy];
CGPoint point;
//Собрать все касания.
NSSet *allTouches = [event allTouches];
for (UITouch *touch in allTouches)
{
point = [touch locationInView:[touch view]];
point = [[CCDirector sharedDirector] convertToGL:point];
if (point.y > 384)
{
if (point.x > 992)
sprite2.position = ccp(992, size.height - 100);
else if (point.x < 32)
sprite2.position = ccp(32, size.height - 100);
else
sprite2.position = ccp(point.x, size.height - 100);
}
else
{
if (point.x > 992)
sprite.position = ccp(992, 100);
else if (point.x < 32)
sprite.position = ccp(32, 100);
else
sprite.position = ccp(point.x, 100);
}
}
}
あなたはpoint.x> 992を使用していますか?それはむしろ大きく見え、iPadの画面でしか動作しません。それでも、それは1024の最大幅(ランドスケープモード)を考慮すると、非常に小さいタッチ領域です。 – badgerr