我正在尝试在cocos2d iPhone游戏中使用this font。字体仅显示字母/数字的2/3rd。如果我打开与OS X一起安装的文本编辑器并使用字体,字母显示得很好。对可能的错误有什么想法吗?
下面的代码片段显示了我如何使用字体显示字符串:
CCLabel* number = [CCLabel labelWithString:@"1" fontName:@"digital-7" fontSize:64];
// position the label on the center of the screen
number.position = ccp( 20 , size.height/2);
number.color = ccc3(0,0,0);
// add the label as a child to this Layer
[self addChild: number];
发布于 2010-02-17 04:07:00
事实证明,需要为CCLabel指定尺寸。默认区域一定是太小了,导致文本被裁剪。当我添加尺寸参数时,文字显示正确。
[CCLabel labelWithString:@"1000" dimensions:CGSizeMake(100, 50) alignment:UITextAlignmentLeft fontName:@"digital-7 (mono)" fontSize:48];
https://stackoverflow.com/questions/2267971
复制相似问题