Cocos2d iphone Kobold2d:kk输入任意触角此帧
Cocos2d iphone Kobold2d:kk输入任意触角此帧,cocos2d-iphone,kobold2d,Cocos2d Iphone,Kobold2d,anytouchindedthis frame肯定是有问题的,我现在已经尝试了所有的方法,如果我移动手指,它只会计算一次结束的触摸,如果我在同一点触摸并放开,它不会计算,如果我错了,请纠正我 -(void) moveObjectToNewPosition:(KKInput *)input { if (input.anyTouchEndedThisFrame) { [self touchesEnded:[input locationOfAnyTouchInPhase:KKT
anytouchindedthis frame
肯定是有问题的,我现在已经尝试了所有的方法,如果我移动手指,它只会计算一次结束的触摸,如果我在同一点触摸并放开,它不会计算,如果我错了,请纠正我
-(void) moveObjectToNewPosition:(KKInput *)input
{
if (input.anyTouchEndedThisFrame) {
[self touchesEnded:[input locationOfAnyTouchInPhase:KKTouchPhaseAny]];
} if (input.anyTouchBeganThisFrame) {
[self touchesBegan:[input locationOfAnyTouchInPhase:KKTouchPhaseBegan]];
}
它从来没有工作,甚至对我来说,你应该实现这个方法,这是非常简单的使用
-(void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSSet *allTouches = [event allTouches];
UITouch * touch = [[allTouches allObjects] objectAtIndex:0];
CGPoint location = [touch locationInView: [touch view]];
location = [[CCDirector sharedDirector] convertToGL:location];
}
-(void) ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
}
-(void) ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
}
并将以下内容添加到您的init中:
[self setTouchEnabled:YES];
隐马尔可夫模型。。使用cocos2d输入似乎也是同样的问题。现在,我还没有禁用kkos2d输入