0
我在我的遊戲加載水平使用MenuLevel .. http://www.prioregroup.com/iphone/menulevel.aspx的Cocos2D MenuLevel如何鎖定,解鎖
目前,這一水平是否被鎖定或沒有,它的加載。如果它是鎖着的,它不應該正在加載..我該怎麼做?謝謝..
//創建菜單項
[menu createMenuItemLevel:1 position:ccp(x, size.height/2) life:0 locked:NO];
- (void)menuLevel:(MenuLevel *)menuLevel buttonSelected:(id)source
{
CCMenuItem *item = (CCMenuItem*)source;
NSString *msg = [NSString stringWithFormat:@"You have pressed the button # %d", item.tag]; // retrieve level number..
NSLog(@"MenuLevel Sample %@", msg);
// What I want is something like.. if (item.locked == YES) do something
}
我已經更新我的答案。試試.. –
你試過我的代碼嗎?它工作.. ?? –
謝謝..運行良好.. – user1526474