2012-08-17 7 views

답변

1

서랍 열기 및 닫기에이 코드를 사용했습니다.

-(void)showMyCocos2DDrawer 
{ 
    CGSize s = [[CCDirector sharedDirector] winSize]; 

    self.position = ccp(-s.width,0.0f); //do this in ur init method :) 

    CGPoint pos =ccp(0.0f, 0.0f); 

    id moveTo = [CCMoveTo actionWithDuration:0.5f position:pos]; 
    id calFun = [CCCallFunc actionWithTarget:self selector:@selector(animDone)]; 
    id seq = [CCSequence actions:moveTo, calFun, nil]; 

    [self runAction:seq]; 
} 



-(void)hideCocos2DDrawer 
{ 
    CGSize s = [[CCDirector sharedDirector] winSize]; 

    CGPoint pos =ccp(-s.width, 0.0f); 

    id moveTo = [CCMoveTo actionWithDuration:0.3f position:pos]; 
    id calFun = [CCCallFunc actionWithTarget:self selector:@selector(goBack)]; 
    id seq = [CCSequence actions:moveTo, calFun, nil]; 

    [self runAction:seq]; 
} 

-(void) animDone 
{ 
//write in code here.. 
} 

-(void)goBack 
{ 
//write out code here.. 
} 
+0

고마워요! 나는 이것을 시험해 보겠다. – MiuMiu

관련 문제