cocos2d-x画图问题

我想用自己的一张图片作为笔刷进行画图,
图不一定多复杂,可能只是直线,矩形,圆啥的。
好像最新版本画图只有CCRenderTexture,CCDrawingPrimitives和一个啥不知道咋用的CCDrawingNode了
如果用CCRenderTexture,我想只用两点画直线,看了下代码好像不行。
CCDrawingPrimitives倒是有两点画线的,但是我不知道如何定义笔刷,默认的线条实在没法见人。
CCDrawingNode不知道咋用,看了下好像也没有提供类似方法。
记得很早以前有个CCRibbon的,现在不知道为啥没了。
请教各位有啥好办法没?

在CCRenderTexture里面定义笔刷

// create a brush image to draw into the texture with
m_pBrush = CCSprite::create(“Images/fire.png”);
m_pBrush->retain();
m_pBrush->setColor(ccRED);
m_pBrush->setOpacity(20);

// for extra points, we'll draw this smoothly from the last position and vary the sprite's
// scale/rotation/offset
float distance = ccpDistance(start, end);
if (distance > 1)
{
    int d = (int)distance;
    for (int i = 0; i < d; i++)
    {
        float difx = end.x - start.x;
        float dify = end.y - start.y;
        float delta = (float)i / distance;
        m_pBrush->setPosition(ccp(start.x + (difx * delta), start.y + (dify * delta)));
        m_pBrush->setRotation(rand() % 360);
        float r = (float)(rand() % 50 / 50.f) + 0.25f;
        m_pBrush->setScale(r);
        /*m_pBrush->setColor(ccc3(CCRANDOM_0_1() * 127 + 128, 255, 255));*/
        // Use CCRANDOM_0_1() will cause error when loading libtests.so on android, I don't know why.
        m_pBrush->setColor(ccc3(rand() % 127 + 128, 255, 255));
        // Call visit to draw the brush, don't call draw..
        m_pBrush->visit();
    }
}

不错!

— Begin quote from ____

引用第1楼robslove于2013-12-31 09:34发表的 :
在CCRenderTexture里面定义笔刷

// create a brush image to draw into the texture with
m_pBrush = CCSprite::create(“Images/fire.png”);
m_pBrush->retain();
http://www.cocoachina.com/bbs/job.php?action=topost&tid=177208&pid=866298

— End quote