Ejemplo n.º 1
0
void HomeScene::__initLighting()
{
    const int deg = 30;
    CCSpriteBatchNode *pLightingNode = CCSpriteBatchNode::createWithTexture(SPRITE("*****@*****.**")->getTexture());
    for(int i=0; i<6; i++)
    {
        CCSprite *light = SPRITE("*****@*****.**");
        light->setRotation(i*deg);
        light->setScale(2);
        pLightingNode->addChild(light);
    }

    ccBlendFunc cbl = {GL_DST_COLOR, GL_ONE};
    pLightingNode->setBlendFunc(cbl);
    pLightingNode->setPosition(VisibleRect::center());
    addChild(pLightingNode);
    //使光芒开始旋转
    CCRotateBy *rotateAct = CCRotateBy::create(1,30);
    pLightingNode->runAction(CCRepeatForever::create(rotateAct));
}