Android COCOS 2dx setColor(Color3B::绿色)不工作

Android COCOS 2dx setColor(Color3B::绿色)不工作,android,c++11,cocos2d-x,Android,C++11,Cocos2d X,当我试图将ios游戏发布到android中时,setColor(Color3B::GREEN)不起作用,字体的颜色不正确 l_answer = Label::createWithTTF(label_config,str_numberStr ); l_answer->setColor(Color3B::GREEN); l_answer->enableOutline(Color4B(0,0,0,255),255); l_answer->enableGlow(Color4B(0,0,

当我试图将ios游戏发布到android中时,setColor(Color3B::GREEN)不起作用,字体的颜色不正确

l_answer = Label::createWithTTF(label_config,str_numberStr );
l_answer->setColor(Color3B::GREEN);
l_answer->enableOutline(Color4B(0,0,0,255),255);
l_answer->enableGlow(Color4B(0,0,0,225));
l_answer->setScale(0.0f);

字体颜色不正确。

不能在标签上设置多个效果。在
ccTypes.h
中的
enum class LabelEffect
中定义的效果,它们相互抵消。现在,您只能看到光晕效果,但如果您交换
启用轮廓()
和启用光晕(),您将只看到轮廓效果。
例如,对于代码

Label* lbSomeText = Label::createWithTTF("sometext", "fonts/junegull_rg.ttf", 100);
lbSomeText->setPosition(Vec2(winSize.width * 0.5f, winSize.height * 0.5f));
lbSomeText->setColor(230,110,180); // I set for more contrast with green
lbSomeText->enableGlow(Color4B(0,0,0,255));
lbSomeText->enableOutline(Color4B(0,255,0,255), 15);
this->addChild(lbSomeText);
结果是:

代码

...
lbSomeText->enableOutline(Color4B(0,255,0,255), 15);
lbSomeText->enableGlow(Color4B(0,0,0,255));
...
结果是:

接下来,如果您想看到绿色的效果,您需要将颜色4B(r,g,b,alpha)设置为颜色4B(0,255,0,255)。现在您有了
(0,0,0,255)
,结果是
黑色
颜色。例如,这里是
lbSomeText->enableGlow(Color4B(0255,0255))的结果

正如您所看到的,绿色和黑色发光之间几乎并没有区别,因为您无法设置发光的宽度。所以,如果您需要更多光晕,更好的方法是在Photoshop之类的设计器程序中从标签文本制作精灵,并在此程序中手动添加更多光晕。
我希望,我回答了你的问题。现在,您可以选择最适合您的选项。

什么是“未正确显示”意思?实际上,我希望标签(字体)颜色应为深绿色。但默认情况下,标签(字体)颜色为黑色。字体的颜色不显示。