最近要用到 Label 的外发光效果,找了一下实现还是挺简单的,但是一直看不到荧光的效果。
代码如下:
TTFConfig ttfConfig(ConstFontCommon, 120, GlyphCollection::DYNAMIC, nullptr, true);
ttfConfig.distanceFieldEnabled = true;
ttfConfig.outlineSize = 0; // outlineSizze 设为 20 也试了,没有效果
Label *labelResult = Label::createWithTTF(ttfConfig, "");
labelResult->setString("victory");
labelResult->setColor(Color3B::RED);
labelResult->enableGlow(Color4B::RED);
labelResult->setPosition(Vec2(this->getContentSize().width * 0.5, this->getContentSize().height * 0.5));
this->addChild(labelResult);
麻烦帮我看看是哪里的问题,谢谢啦!
另外,荧光的大小能调整吗?