CCLabelAtlas

1.CCLabelAtlas 的具体用法

CCLabelAtlas *pLabel = new CCLabelAtlas;
pLabel ->initWithString("0123",  m_strPath.c_str(), 14/ CC_CONTENT_SCALE_FACTOR(), 17/ CC_CONTENT_SCALE_FACTOR(), '%');
pLabel ->setAnchorPoint(ccp(0, 0.5));
pLabel ->setPosition(ccp(pTributeSpriteSpecific->getContentSize().width + 3/CC_CONTENT_SCALE_FACTOR(),pTributeSpriteSpecific->getContentSize().height - 18/CC_CONTENT_SCALE_FACTOR()));

initWithString(要显示的数,png图片路径,单个图片的宽,单个图片高,开始字符);

2.使用TexturePacker 打图参数设置

3.图片命名方式00、01......这样为了方便自动排序,因为CCLabelAtlas 是根据ascii码表 来排序切取字符的所以要使用占位符代替。

 

 注意当发现切图排序和尺寸都正确时发现还是不对修改一下属性如图::::

原文地址:https://www.cnblogs.com/cci8go/p/3612323.html