使用自定义字体文件创建 CCMenuItemLabel [英] create a CCMenuItemLabel with a custom font file

查看:16
本文介绍了使用自定义字体文件创建 CCMenuItemLabel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 CCMenuitemLabel

I have a CCMenuitemLabel

  CCMenuItemLabel *startGame = [CCMenuItemLabel itemWithLabel:str target:self selector:@selector(startGamefn)];

我想知道如何像在 CCLabelBMFont 中那样加载字体文件(例如:

and I was wondering how I would load a font file as you would do in CCLabelBMFont (example :

CCLabelBMFont *label = [CCLabelBMFont labelWithString:str fntFile:@"good_dog_plain_32.fnt"];

谢谢

推荐答案

CCMenuItemLabel 可以接受 CCLabelBMFont,因此您可以将函数调用中的 label 对象传递给 CCMenuItemLabel:

CCMenuItemLabel can accept CCLabelBMFont so you can just past the label object in the function call to CCMenuItemLabel:

CCLabelBMFont *label = [CCLabelBMFont labelWithString:str fntFile:@"good_dog_plain_32.fnt"];
CCMenuItemLabel *startGame = [CCMenuItemLabel itemWithLabel:label target:self selector:@selector(startGamefn)];

这篇关于使用自定义字体文件创建 CCMenuItemLabel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆