我正在尝试创建CCLabelTTF
文本随着故事的进展而变化的位置,但我无法为其设置一段简单的文本。标签当前显示(空),我似乎无法让它显示“这是文本”。NSLog
正确返回它,但标签不会显示它。我还确保标签没有被破坏。这是代码:
CGSize narrativeTextSize;
narrativeTextSize.width=740;
narrativeTextSize.height=60;
CCLabelTTF *narrativeTextLabel =[CCLabelTTF labelWithString:[NSString
stringWithFormat:@"%@", narrativeText]
dimensions:narrativeTextSize
hAlignment:UITextAlignmentLeft
lineBreakMode:UILineBreakModeWordWrap
fontName:@"Helvetica"
fontSize:20];
narrativeTextLabel.position = ccp(255,60);
narrativeText = @"This is text";
//NSLog(@"%@", narrativeText);
[gameMenu addChild:narrativeTextLabel];