3140 auto s = Director::getInstance()->getWinSize();
3143 auto label1 = Label::createWithBMFont(
"fonts/bitmapFontTest2.fnt",
"hello non-underline", TextHAlignment::CENTER, s.width);
3145 label1->setPosition(Vec2(s.width/2, s.height*4/6));
3148 _label1a = Label::createWithBMFont(
"fonts/bitmapFontTest2.fnt",
"hello underline", TextHAlignment::CENTER, s.width);
3150 _label1a->setPosition(Vec2(s.width/2, s.height*3/6));
3156 TTFConfig ttfConfig(
"fonts/arial.ttf",24);
3157 auto label2 = Label::createWithTTF(ttfConfig,
"hello non-underline", TextHAlignment::CENTER,s.width);
3159 label2->setPosition(Vec2(s.width/2, s.height*2/6));
3162 ttfConfig.underline =
true;
3163 _label2a = Label::createWithTTF(ttfConfig,
"hello underline", TextHAlignment::CENTER,s.width);
3165 _label2a->setPosition(Vec2(s.width/2, s.height*1/6));
3167 auto menuItem = MenuItemFont::create(
"disable underline", [&](cocos2d::Ref* sender) {
3168 _label2a->disableEffect(LabelEffect::UNDERLINE);
3169 _label1a->disableEffect(LabelEffect::UNDERLINE);
3171 menuItem->setFontSizeObj(12);
3172 auto menu = Menu::createWithItem(menuItem);
3174 auto winSize = Director::getInstance()->getWinSize();
3175 menu->setPosition(winSize.width * 0.9, winSize.height * 0.25f);
cocos2d::Label * _label2a
cocos2d::Label * _label1a