CCLabelTTF* pLabel = CCLabelTTF::create("Game Begin", "Arial", 24);
CC_BREAK_IF(! pLabel);
// Get window size and place the label upper.
CCSize size = CCDirector::sharedDirector()->getWinSize();
pLabel->setPosition(ccp(size.width / 2, size.height - 50));
// Add the label to HelloWorld layer as a child layer.
this->addChild(pLabel, 1);
本文介绍如何使用Cocos2d-x游戏引擎中的CCLabelTTF类创建并显示文本标签,包括设置字体、大小及位置等操作。
835

被折叠的 条评论
为什么被折叠?



