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

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

问题描述

我有一个CCMenuitemLabel

I have a CCMenuitemLabel

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

我想知道如何加载一个字体文件像你会在CCLabelBMFont(例如: / p>

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,因此您可以在对 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天全站免登陆