我爲我的遊戲使用了custom localization system;該教程中,他增加了標籤,自定義方法,但我的文字標籤在初始化cocos2d iphone遊戲定製本地化系統
教程的例子說:
- (void) setHelloWorldLabel
{
// create and initialize a Label
CCLabel* label = [CCLabel labelWithString:AMLocalizedString(@"hello",@"Hello World") fontName:@"Marker Felt" fontSize:32];
// ask director the the window size
CGSize size = [[CCDirector sharedDirector] winSize];
// position the label on the center of the screen
label.position = ccp(size.width /2 , size.height/2);
//Check if it's already been added to the layer.
if ([self getChildByTag:50])
[self removeChildByTag:50 cleanup:YES];
// add the label as a child to this Layer
[self addChild:label z:0 tag:50];
}
設置語言
-(void) menuCallbackEN: (id) sender
{
LocalizationSetLanguage(@"English");
[self setHelloWorldLabel];
}
如何處理多個文本標籤?
一些代碼示例將幫助我:)
您的意思是當標籤爲'50'的多標籤標籤出現問題時該怎麼辦? – jonsibley 2012-04-05 12:41:56
@jonsibley:不,我的意思是當我有多個文本標籤時;不同的人 – 2012-04-05 12:46:42