c++ - 在 iOS 的 cocos2d-x v3 中使用自定义字体

标签 c++ cocos2d-x

我正在尝试在 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/

相关文章:

c++ - cocos2d-x 中的鼠标/触摸坐标

cocos2d-x - 使用Cocos2d-X检测IOS版本

android - 如何在 cocos2dx 中更新 openssl?

C++如何在 vector 中添加 vector ? vector .push_back( vector <>)?

c++ - 按列而不是行存储矩阵

c++ - Visual Studio 2015:std::vector 的可视化不在调试中显示信息

c++ - Qt:带有文本浏览器的模型/ View 概念

C++ 无法将 'const char*' 转换为 'std::string*'

ios - 如何使CCRenderTexture透明

c++ - cocos2dx 3.3动画实现