0

在 cocos2d for iPhone 中,如何创建一个固定宽度的多行标签(文本框)?

目前,我正在使用:

CCLabelTTF  *labelTextTop = [CCLabelTTF labelWithString: @"My long string that should be placed in two lines, instead of in one extremely long one."
                                        fontName:        @"Marker Felt" 
                                        fontSize:        40];
4

1 回答 1

1

这是我目前使用的:

CGSize size;
size.width=400;
size.height=110;
sayBubbleTextDisplayed_=[[CCLabelTTF  labelWithString:@"some long and winded blabla "  
                                           dimensions:size 
                                            alignment:UITextAlignmentLeft 
                                        lineBreakMode:UILineBreakModeWordWrap
                                             fontName:@"American Typewriter" 
                                             fontSize:16] retain];
于 2012-07-16T14:16:26.603 回答