gpt4 book ai didi

fonts - 如何将位图字体添加到 SpriteBuilder

转载 作者:行者123 更新时间:2023-12-01 10:44:29 25 4
gpt4 key购买 nike

我无法将任何 .fnt/.png 类型的字体添加到 SpriteBuilder,因此我无法为 CCLabelBMFont 选择它们。程序是什么?文档似乎与此事无关。

我正在使用这种字体:

https://github.com/cocos2d/cocos2d-iphone/blob/v3.1/Resources/Fonts/arial16.fnt https://github.com/cocos2d/cocos2d-iphone/blob/v3.1/Resources/Fonts/arial16.png

更新:在这一点上似乎没有真正好的解决方案,除了像这样的解决方法:

  • 在处理 CCLabelBMFont 时不要使用 SpriteBuilder,毕竟如果您从代码中执行它,您可以使用 arial16 字体。遗憾的是 SB 不支持与现有 Cocos2D“捆绑”的字体。当然可能有充分的理由......

  • 在我的例子中,我只使用 CCLayoutBox 并向其添加固定大小的字符 Sprite ,根本不使用任何字体类。它实际上非常快,足以制作倒数计时器等。

最佳答案

如果你有 GlyphDesigner,你可以使用我的 bash 脚本将 .GlyphProject 文件转换为 SpriteBuilder 需要的 .bmfont 字体结构。

你可以在这里查看我的帖子: Bash script to generate CCLabelBMFont bmfont files for use with SpriteBuilder using GlyphDesigner’s command line tool

关于fonts - 如何将位图字体添加到 SpriteBuilder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25679786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com