【问题标题】:CCLabelTTF working in simulator but not in deviceCCLabelTTF 在模拟器中工作但不在设备中
【发布时间】:2012-05-29 18:38:36
【问题描述】:

此代码在模拟器中运行。当我们加载到设备中时它不工作。在控制台中它显示错误为:
Unable to load font BARBATRI.ttf

我的代码是:-

CCLabelTTF *score = [CCLabelTTF labelWithString:[NSString stringWithFormat:@"Score : %d",[CommonUserDetails sharedUserDetails].GameScore] fontName:@"BARBATRI.ttf" fontSize:18];
score.position = ccp(240,160);
score.anchorPoint  = ccp(0.5, 0.5);
[self addChild:score];

【问题讨论】:

    标签: cocos2d-iphone


    【解决方案1】:

    将此字体添加到您的项目资源和 info.plist 文件的“应用程序提供的字体”部分。有可能你在 Mac OS 中有这种字体,但在 iOS 中没有这种字体。

    【讨论】:

    • 没问题。您可以将答案标记为正确,以帮助其他人找到答案 =)
    猜你喜欢
    • 2011-03-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-10
    • 2012-08-19
    • 2023-03-23
    相关资源
    最近更新 更多