0
아래 코드에서 선택기를 만드는 데 문제가 있습니다. 로그조차도 아무 것도 표시하지 않습니다. 이 문제를 어떻게 해결할 수 있습니까?CCMenuItemSprite CCLabelBMFont 선택기가 작동하지 않습니다.
-(void)displaySettingsMenuItems {
CCSprite *buttonHolder = [CCSprite spriteWithFile:@"buttonHolder.png"];
buttonHolder1.position = ccp(screenSize.width/2, screenSize.height/2);
[self addChild:buttonHolder z:ZPos];
CCMenuItemSprite *instructionsItemSprite = [CCMenuItemSprite itemWithTarget:self selector:nil];
CCLabelBMFont *instructionsLabelFont = [CCLabelBMFont labelWithString:@"instructions" fntFile:@"TestingFont.fnt"];
CCMenuItemLabel *instructionsItemLabel = [CCMenuItemLabel itemWithLabel:instructionsLabelFont target:self selector:@selector(instructionsLayer)];
instructionsLabelFont.position =ccp(screenSize.width/2, 0.99*screenSize.height/2);
[instructionsItemSprite addChild: instructionsItemLabel z:ZPos];
[self addChild:instructionsItemSprite z:ZPos];
}
선택기 방법 :
-(void)instructionsLayer {
CCLOG(@"code is okay");
[[MenuManager sharedMenuManager] runWithPrePlayMenu:kInstructions];
}
어떻게 여러 CCMenuItemLabel의 레이블에 대한 올바른 위치를 얻을 수 있습니까? – errorallergic