CCDictionary *strings = CCDictionary::createWithContentsOfFile("tips2.xml");
const char *hello = ((CCString*)strings->valueForKey("tp1"))->m_sString.c_str();
CCLabelTTF *labelHello = CCLabelTTF::create(hello, "fonts/Microsoft YaHei.ttf", 40);
labelHello->setPosition(ccp(100, 100));
labelHello->setAnchorPoint(ccp(0.5, 0.5));
//设置居中对齐
labelHello->setHorizontalAlignment(kCCTextAlignmentLeft);
labelHello->setPosition(ccp(267,182));
//设置显示框大小
labelHello->setDimensions(CCSizeMake(500, 200));
labelHello->setColor(ccc3(6, 48, 90));
pReliveBoard->addChild(labelHello, 1);
时间: 2024-10-13 12:24:50