kobold2d の KKInput を使用して、パン ジェスチャ認識エンジンを使用してドラッグ アンド ドロップを行います。iPhone がテーブルの上に平らに置かれている場合は完全に機能しますが、電話を自分の方に傾けると、翻訳が完全に間違っているように見え、正常に動作しなくなります。実際、iPhone が逆さまになっていると思われるようです。
私は何か間違ったことをしていますか?
サンプルコード:
if([input gesturePanBegan])
{
for( CCSprite* item in self.View.children )
{
bool result = [input isAnyTouchOnNode:item touchPhase: KKTouchPhaseAny];
if (result)
{
itemPanning = item;
originalPostion = item.position;
}
}
CCLOG(@"%f y translation %f x translation", input.gesturePanTranslation.y , input.gesturePanTranslation.x);
if(itemPanning != NULL)
{
[itemPanning setPosition:ccp(input.gesturePanTranslation.x + originalPostion.x, originalPostion.y)];
if(input.gesturePanTranslation.x > 70)
{
[View Select: [itemPanning tag]];
SelectAttackCommand * command = [SelectAttackCommand new];
command.SelectedAttack = [itemPanning tag];
itemPanning = NULL;
NOTIFY(command);
}
}
}
else if(![input gesturePanBegan] && itemPanning != NULL)
{
itemPanning = NULL;
[View Open];
}