0
我的图像看起来像有太多的黑色。我使用功能setBlendFunc
。cocos2dX setBlendFunc
但是,当精灵不运行Animate时,它将工作。如果运行,它不起作用。这怎么解决?
CCSprite *effectSprite=CCSprite::create("init_black.png");
effectSprite->setBlendFunc((ccBlendFunc) {GL_ONE, GL_ONE});
SoliderSprite *enemySolider=(SoliderSprite *)(enemy->objectAtIndex(0));
CCArray *position=enemySolider->soliderPosition;
position->retain();
cout<<((CCString *)position->objectAtIndex(0))->intValue()<<endl;
effectSprite->setPosition(ccp(((CCString *)position->objectAtIndex(0))->intValue(),((CCString *)position->objectAtIndex(1))->intValue()));
this->addChild(effectSprite);
string effectString="effect";
if(this->direction)
{
msg.property[1].append("L");
}
else
{
msg.property[1].append("R");
}
CCAnimate *effectAction=animate->createWithKind(msg.property[1],effectString.c_str(),2);
effectSprite->runAction(effectAction);
position->release();