【问题标题】:initWithString of CCLabelBMFont COCOS2D class throws NSInternalInconsistencyException exceptionCCLabelBMFont COCOS2D 类的 initWithString 抛出 NSInternalInconsistencyException 异常
【发布时间】:2014-08-16 22:36:39
【问题描述】:

以这种方式实例化 CCLabelBMFont

   _targetDistanceBM =[[CCLabelBMFont alloc] initWithString:@"" fntFile:@"font.fnt"]

导致异常“由于未捕获的异常 'NSInternalInconsistencyException' 导致应用程序终止,原因:'TextureCache: fileimage MUST not be nil'”

根据许多帖子,这似乎是创建它的方式。

字体文件是使用在线工具littera创建的。

我使用的是 COCOS3D 自带的 COCOS2D 第 3 版。

【问题讨论】:

    标签: cocos2d-iphone cocos3d


    【解决方案1】:

    COCO2D 仅支持文本格式的 fnt 文件。另外,对应的 png 文件必须和 fnt 文件放在同一个文件夹中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-02
      • 1970-01-01
      • 2011-02-07
      • 1970-01-01
      • 2013-05-24
      • 1970-01-01
      相关资源
      最近更新 更多