Cocos2d 字体扩展问题

发布于 2024-11-27 08:57:08 字数 357 浏览 2 评论 0原文

下午好,运动会!

我有一个快速的疑问。 我正在使用 COCOS2D,我需要知道是否可以使用除“.fnt”之外的其他扩展类型的字体。 因为我用了一些但没有任何运气。

我正在使用这段代码来制作“制作人员名单”场景:

CCBitmapFontAtlas* l_026  = [CCBitmapFontAtlas bitmapFontAtlasWithString:@"Look for our apps in the AppStore"   fntFile:@"fission.fnt"];

如果不是,我可以使用哪个? 您知道有什么字体转换器可以将“普通字体”更改为“.fnt”吗?

谢谢!

Good afternoon, sports!

I have a fast doubt.
I'm using COCOS2D and i need to know if i can use other extension type of font other than ".fnt".
Because i used a few and didn't have any luck.

I'm using this piece of code to make a "credits" scene:

CCBitmapFontAtlas* l_026  = [CCBitmapFontAtlas bitmapFontAtlasWithString:@"Look for our apps in the AppStore"   fntFile:@"fission.fnt"];

If it isn't which can i use?
And it is do you know any font converter to change "normal fonts" to ".fnt"

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

残月升风 2024-12-04 08:57:08

我认为最好的字体程序是:Glyph Designer。它价格便宜,而且很容易制作出漂亮的字体。

我使用 CCLabelBMFont 但我很确定它基本上是相同的东西。

The best font program in my opinion is: Glyph Designer. It is inexpensive and very easy to make great looking fonts.

I use CCLabelBMFont but I'm pretty sure it is basically the same thing.

雨落□心尘 2024-12-04 08:57:08

如果您有一些现金可以花,您可以按照 Aaron 的建议使用 Glyph Designer。但您也可以使用名为 Hiero 的免费 Java 工具。不过,您可能需要进行一些调整才能获得您想要的结果。

该工具将输出 2 个文件:一个 .png 和另一个 .fnt。将这些文件添加到您的 Xcode 项目中,并使用如下简单的行来使用它:

CCLabelBMFont *some_label = [CCLabelBMFont labelWithString:@"Your Text" fntFile:@"fontfile.fnt"];

请注意,每对 fnt/png 文件的字体大小是固定的,因此如果您想要使用不同的字体,则必须创建多对文件尺寸。此外,您还需要单独的视网膜和非视网膜显示模式对。

If you have some cash to spend you can use Glyph Designer as suggested by Aaron. But you can also use a free Java tool named Hiero. You might have to do some tweaking to get the result you want though.

The tool will output 2 files: one .png and another .fnt. Add these files into your Xcode project and use it using simple lines like below:

CCLabelBMFont *some_label = [CCLabelBMFont labelWithString:@"Your Text" fntFile:@"fontfile.fnt"];

Do note though that the size of the font from each pair of fnt/png files is fixed, so you have to create multiple pairs if you want to have different font sizes. Also, you need separate pair for Retina and non-Retina display modes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文