3088 auto s = Director::getInstance()->getWinSize();
3091 auto label1 = Label::createWithBMFont(
"fonts/bitmapFontTest2.fnt",
"hello non-bold", TextHAlignment::CENTER, s.width);
3093 label1->setPosition(Vec2(s.width/2, s.height*4/6));
3096 _label1a = Label::createWithBMFont(
"fonts/bitmapFontTest2.fnt",
"hello bold", TextHAlignment::CENTER, s.width);
3098 _label1a->setPosition(Vec2(s.width/2, s.height*3/6));
3104 TTFConfig ttfConfig(
"fonts/arial.ttf",24);
3105 auto label2 = Label::createWithTTF(ttfConfig,
"hello non-bold", TextHAlignment::CENTER,s.width);
3107 label2->setPosition(Vec2(s.width/2, s.height*2/6));
3110 ttfConfig.bold =
true;
3111 _label2a = Label::createWithTTF(ttfConfig,
"hello bold", TextHAlignment::CENTER,s.width);
3113 _label2a->setPosition(Vec2(s.width/2, s.height*1/6));
3115 auto menuItem = MenuItemFont::create(
"disable bold", [&](cocos2d::Ref* sender) {
3116 _label2a->disableEffect(LabelEffect::BOLD);
3117 _label1a->disableEffect(LabelEffect::BOLD);
3119 menuItem->setFontSizeObj(12);
3120 auto menu = Menu::createWithItem(menuItem);
3122 auto winSize = Director::getInstance()->getWinSize();
3123 menu->setPosition(winSize.width * 0.9, winSize.height * 0.25f);
cocos2d::Label * _label2a
cocos2d::Label * _label1a