//
// TintTo
//
CCTintTo* CCTintTo::actionWithDuration(ccTime duration, CCubyte red, CCubyte green, CCubyte blue)
{
	CCTintTo *pTintTo = new CCTintTo();
	pTintTo->initWithDuration(duration, red, green, blue);
	pTintTo->autorelease();

	return pTintTo;
}
//
// TintTo
//
CCTintTo* CCTintTo::create(float duration, CCubyte red, CCubyte green, CCubyte blue)
{
	CCTintTo *pTintTo = new CCTintTo();
	pTintTo->initWithDuration(duration, red, green, blue);
	pTintTo->autorelease();

	return pTintTo;
}
Beispiel #3
0
CommandHit* CommandHit::create(ID iid)
{
	CommandHit* hit = new CommandHit();
	Actor* actor = Engine::world->getActor(iid);
	hit->mActorSprite = actor->sprite();
	CCTintTo* tintTo = CCTintTo::create(0.1f, 50, 0, 0);
	tintTo->retain();
	CCReverseTime *tintBack = CCReverseTime::create(tintTo);
	tintBack->retain();
	hit->mTint = CCSequence::createWithTwoActions(tintTo, tintBack);
	hit->mTint->retain();
	hit->mHitEmitter = CCParticleSystemQuad::create("Data/hit.xml");
	hit->mHitEmitter->retain();
	return hit;
}
CCObject* CCTintTo::copyWithZone(CCZone *pZone)
{
	CCZone* pNewZone = NULL;
	CCTintTo* pCopy = NULL;
	if(pZone && pZone->m_pCopyObject) 
	{
		//in case of being called at sub class
		pCopy = (CCTintTo*)(pZone->m_pCopyObject);
	}
	else
	{
		pCopy = new CCTintTo();
		pZone = pNewZone = new CCZone(pCopy);
	}

	CCActionInterval::copyWithZone(pZone);

	pCopy->initWithDuration(m_fDuration, m_to.r, m_to.g, m_to.b);
	
	CC_SAFE_DELETE(pNewZone);
	return pCopy;
}