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

时间:2015-01-09 20:59:57   收藏:0   阅读:514


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,255,0));

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

                this->addChild(scoreLab, 2);



原文:http://blog.csdn.net/a1977722280/article/details/42558961

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!