简体   繁体   English

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

[英]Use custom font in cocos2d-x v3 in iOS

I'm trying to use a custom font in Cocos2d-x v3 in iOS. 我正在尝试在iOS的Cocos2d-x v3中使用自定义字体。 I'm following these steps: http://www.cocos2d-x.org/wiki/How_to_Use_Custom_TTF_Font_on_iOS 我正在按照以下步骤操作: http : //www.cocos2d-x.org/wiki/How_to_Use_Custom_TTF_Font_on_iOS

But when I run the app, the font doesn't appears (the label works properly, expect for the font). 但是,当我运行该应用程序时,字体没有出现(标签正常工作,需要字体)。

This is my code: 这是我的代码:

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);

Just to close the question. 只是为了结束问题。 The answer given by @essess in the commens worked perfectly. @essess在命令中给出的答案非常有效。

Answer: 回答:

if you are using fonts/Aller.ttf in your plist file, remove the path "fonts/" instead just use Aller.ttf in the plist file 如果您在plist文件中使用fonts / Aller.ttf,请删除路径“ fonts /”,而仅在plist文件中使用Aller.ttf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM