@mobilebros - Thank you very much for your reply.
>>1. Well not exactly, but I could look at that as well.
It could be awesome to see that fixed. If you happen to fix it, please post the code here or update the class and make an announcement here.
>>2. This is why touchPriority is exposed, together with the whole swallowsTouches concept in cocos will allow whatever behavior you want without having rip anything apart.
I don't really understand how to control that. Can you help me with this example (it's your touch code from the AB-SpaceManager tutorial):
-(BOOL) ccTouchBegan:(UITouch*)touch withEvent:(UIEvent *)event
{
CGPoint pt = [self convertTouchToNodeSpace:touch];
float radiusSQ = 25*25;
//Get the vector of the touch
CGPoint vector = ccpSub(ccp(60,157, pt);
//Are we close enough to the slingshot?
if (ccpLengthSQ(vector) < radiusSQ)
return YES;
else
return NO;
}
-(void) ccTouchMoved:(UITouch*)touch withEvent:(UIEvent *)event
{
CGPoint pt = [self convertTouchToNodeSpace:touch];
CGPoint bombPt = ccp(60,166);
//Get the vector, angle, length, and normal vector of the touch
CGPoint vector = ccpSub(pt, bombPt);
CGPoint normalVector = ccpNormalize(vector);
float angleRads = ccpToAngle(normalVector);
int angleDegs = (int)CC_RADIANS_TO_DEGREES(angleRads) % 360;
float length = ccpLength(vector);
//Correct the Angle; we want a positive one
while (angleDegs < 0)
angleDegs += 360;
//Limit the length
if (length > 25)
length = 25;
//Limit the angle
if (angleDegs > 245)
normalVector = ccpForAngle(CC_DEGREES_TO_RADIANS(245));
else if (angleDegs < 110)
normalVector = ccpForAngle(CC_DEGREES_TO_RADIANS(110));
//Set the position
_curBomb.position = ccpAdd(bombPt, ccpMult(normalVector, length));
}
-(void) ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event
{
CGPoint vector = ccpSub(ccp(60,166), _curBomb.position);
if (_curBomb)
[smgr morphShapeToActive:_curBomb.shape mass:30];
[_curBomb applyImpulse:cpvmult(vector, 240)];
[self setupNextBomb];
}
/////////////////////////////////////
When I use this and the pan-zoom class, if I touch the bomb the layer underneath also moves. How can I stop that and have either the bomb or the layer moving separately?