我正在为我的游戏使用自定义本地化系统;在那个教程中,他在自定义方法中添加了标签,但我的文本标签是在 init 中添加的
教程示例:
- (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];
}
如何处理多个文本标签?
一些代码示例会帮助我:)