2017-05-03 293 views
0

我目前收到以下错误。我确定我在资源 - >字体文件夹中有Mark Felt.ttf文件。目前,我正在为android-studio开发Android。我想知道,问题是什么?我很想听到你的消息!无法解决fullPathForFilename:cocos2dx中可能缺少文件错误

cocos2d: fullPathForFilename: No file found at Mark Felt. Possible missing file. 

代码

auto highscoreLabelHeader = Label::createWithSystemFont("HIGHSCORE", "Mark Felt", 16); 

回答

1

你应该使用相对路径来你的字体文件,从资源文件夹起根。即,如果您有子文件夹,只要使用fonts/Mark Felt.ttf

auto label= Label::createWithSystemFont("xyz", "fonts/Mark Felt.ttf", 16); 

,并且确保Mark Felt是systemFont以其它方式使用

auto label= Label::createWithTTF("xyz", "fonts/Mark Felt.ttf", 16) 

而且还可以检查此线程

http://discuss.cocos2d-x.org/t/fonts-not-working-on-android-device/7535

相关问题