cocos2d-x 3.2
[how to draw alpha line]DrawPrimitives::setDrawColor4B alpha is not woking?
my code: DrawPrimitives::setDrawColor4B(255,0,0,0);, alpha = 0 is show the line, how to show alpha = 0.1 line
void GameStageLayer_Level_1_0::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
{
_customCommand.init(_globalZOrder);
_customCommand.func = CC_CALLBACK_0(GameStageLayer_Level_1_0::onDraw, this, transform, flags);
renderer->addCommand(&_customCommand);
}
void GameStageLayer_Level_1_0::onDraw(const Mat4 &transform, uint32_t flags)
{
//return;
Director* director = Director::getInstance();
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, transform);
CHECK_GL_ERROR_DEBUG();
{
float width_line = 5.0f;
DrawPrimitives::setDrawColor4B(255,0,0,255*1.0/100.0);
glLineWidth( width_line );