cocos2d iphone - Kobold2d: KKInput anyTouchEndedThisFrame -
the anytouchendedthisframe
must buggy i´ve tried now, , reckonize touch that´s ended if move finger, if touch , let go @ same spot not reckonize it, if wrong please correct me
-(void) moveobjecttonewposition:(kkinput *)input { if (input.anytouchendedthisframe) { [self touchesended:[input locationofanytouchinphase:kktouchphaseany]]; } if (input.anytouchbeganthisframe) { [self touchesbegan:[input locationofanytouchinphase:kktouchphasebegan]]; }
it has never worked me, should implement method simple use
-(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 { }
and add init this:
[self settouchenabled:yes];
Comments
Post a Comment