私のゲームにはcustom localization systemが使用されています。そのチュートリアルでは、彼は独自の方法でラベルを追加しますが、私のテキストラベルを初期化iphoneゲーム用のcocos2dカスタムローカライゼーションシステム
チュートリアルの例で追加されています
-(void) menuCallbackEN: (id) sender
{
LocalizationSetLanguage(@"English");
[self setHelloWorldLabel];
}
がどのように複数のテキストラベルに対処するための言語を設定する
- (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];
}
?
いくつかのサンプルコードは、私を助けるだろう:)
タグ「50」のマルチプルラベルがある場合、どうすればよいか質問してください。 – jonsibley
@jonsibley:いいえ、私は複数のテキストラベルを持っていることを意味します。別のもの –