加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Cocos2dx CCLabelAtlas字体与CCLabelTTF字体的使用方法

发布时间:2020-12-14 20:02:38 所属栏目:百科 来源:网络整理
导读:?? 1.26 、字体 1、 CCLabelAtlas 字体 示例代码: CCLabelAtlas * LBsocre4 = CCLabelAtlas :: create ( CCString :: createWithFormat ( "%d" ,c)- getCString (), "labelatlasimg.png" ,24,32, '0' ); LBsocre4 - setAnchorPoint (ccp(0,0.5)); LBsocre4
??

1.26、字体

1、CCLabelAtlas字体

示例代码:

CCLabelAtlas*LBsocre4=CCLabelAtlas::create(CCString::createWithFormat("%d",c)->getCString(),"labelatlasimg.png",24,32,'0');

LBsocre4->setAnchorPoint(ccp(0,0.5));

LBsocre4->setPosition(ccp(200,200));

LBsocre4->setScale(0.7f);

LBsocre4->setString(CCString::createWithFormat("%d",c)->getCString());

this->addChild(LBsocre4,5);

2、CCLabelTTF字体

示例代码:

CCLabelTTF*scoreLab=CCLabelTTF::create("0","Arial",35);

scoreLab->setPosition(ccp(a,b));

scoreLab->setAnchorPoint(ccp(0,1));

scoreLab->setColor(ccc3(255,0));

scoreLab->setString(CCString::createWithFormat("%d",c)->getCString());

this->addChild(scoreLab,2);

??

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读