我有一个 CCMenuitemLabel
CCMenuItemLabel *startGame = [CCMenuItemLabel itemWithLabel:str target:self selector:@selector(startGamefn)];
我想知道如何像在 CCLabelBMFont 中那样加载字体文件(例如:
CCLabelBMFont *label = [CCLabelBMFont labelWithString:str fntFile:@"good_dog_plain_32.fnt"];
谢谢
最佳答案
CCMenuItemLabel 可以接受 CCLabelBMFont,因此您可以将函数调用中的 label
对象传递给 CCMenuItemLabel
:
CCLabelBMFont *label = [CCLabelBMFont labelWithString:str fntFile:@"good_dog_plain_32.fnt"];
CCMenuItemLabel *startGame = [CCMenuItemLabel itemWithLabel:label target:self selector:@selector(startGamefn)];
关于ios - 使用自定义字体文件创建 CCMenuItemLabel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7628893/