how to declare label in global class (helloworld.h) with cocos2d-x v3.2?

别来无恙 提交于 2019-12-06 04:57:35
AnjDenny

In .h file

Label *autolabel4;

in .cpp

// autolabel4 = Label::create(); can't improve label size and fount

autolabel4 = Label::createWithSystemFont("hello","Arial.ttf",40);
  autolabel4->setString("name isss :");
  autolabel4->setColor(Color3B(23,33,44));
  autolabel4->setPosition(Point(origin.x+ visibleSize.width/2,
                              origin.y + visibleSize.height - 400));
      this->addChild(autolabel4, 1);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!