我正在尝试在 iOS 的 Cocos2d-x v3 中使用自定义字体。 我正在执行以下步骤: http://www.cocos2d-x.org/wiki/How_to_Use_Custom_TTF_Font_on_iOS
但是当我运行应用程序时,字体没有出现(标签工作正常,期待字体)。
这是我的代码:
auto playerLabel = LabelTTF::create("Player", "Aller.ttf", 32);
playerLabel->setPosition(Point(40, visibleSize.height - playerProfile->getContentSize().height - 10));
playerLabel->setColor(ccc3(1,1,1));
playerLabel->setAnchorPoint(Point(0.0f, 0.0f));
this->addChild(playerLabel,5);
最佳答案
只是为了结束这个问题。 @essess 在评论中给出的答案非常有效。
回答:
如果您在 plist 文件中使用 fonts/Aller.ttf,请删除路径“fonts/”,而仅在 plist 文件中使用 Aller.ttf
关于c++ - 在 iOS 的 cocos2d-x v3 中使用自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23841445/