Cocos2d x 如何用指定的颜色填充ccsprite中的颜色?

Cocos2d x 如何用指定的颜色填充ccsprite中的颜色?,cocos2d-x,Cocos2d X,我试图用指定的颜色绘制一个填充矩形 怎么做 下面是测试代码 void MySprite::draw(void) { glLineWidth(1); ccDrawColor4F(255 / 255.0f , 0 / 255.0f , 0 / 255.0f , 200 / 255.0f); ccDrawRect(CCPointMake(0 , 0), CCPointMake(int_width , int_height)); //How to fill in t

我试图用指定的颜色绘制一个填充矩形

怎么做

下面是测试代码

void MySprite::draw(void) 
{

    glLineWidth(1);
    ccDrawColor4F(255 / 255.0f , 0 / 255.0f , 0 / 255.0f , 200 / 255.0f);
    ccDrawRect(CCPointMake(0 , 0), CCPointMake(int_width , int_height));

    //How to fill in this rectangle?
}

您应该使用:
ccDrawSolidRect(CCPoint原点、CCPoint终点、ccColor4F颜色)

参考: