Ios 屏幕外视差节点与cclayers一起滚动

Ios 屏幕外视差节点与cclayers一起滚动,ios,ipad,cocos2d-iphone,nodes,parallax,Ios,Ipad,Cocos2d Iphone,Nodes,Parallax,管理使用视差节点滚动我的CCLayers,但如何设置滚动的边界 使用: - (void)registerWithTouchDispatcher { [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:1 swallowsTouches:NO]; } -(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event { ret

管理使用视差节点滚动我的CCLayers,但如何设置滚动的边界

使用:

- (void)registerWithTouchDispatcher {
    [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:1 swallowsTouches:NO];
}

-(BOOL) ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event {
    return YES;
}

-(void) ccTouchMoved:(UITouch *)touch withEvent:(UIEvent *)event
{
    CGPoint touchLocation = [touch locationInView: [touch view]];   
    CGPoint prevLocation = [touch previousLocationInView: [touch view]];    

    touchLocation = [[CCDirector sharedDirector] convertToGL: touchLocation];
    prevLocation = [[CCDirector sharedDirector] convertToGL: prevLocation];

    CGPoint diff = ccpSub(touchLocation,prevLocation);

    CCNode *node = [self getChildByTag:kTagNode];
    CGPoint currentPos = [node position];
    [node setPosition: ccpAdd(currentPos, diff)];

}

您可以设置ZoomController的SweentStouches属性,并查看TargetTouchDelegate以处理更复杂的触摸事件。

但我如何同时拥有它们呢?我的视差图像更大,如果一直向右滚动,我会看到一个精灵,它是向后的,够不着它。。。