//
// FadeTo
//
CCFadeTo* CCFadeTo::actionWithDuration(ccTime duration, CCubyte opacity)
{
	CCFadeTo *pFadeTo = new CCFadeTo();
	pFadeTo->initWithDuration(duration, opacity);
	pFadeTo->autorelease();

	 return pFadeTo;
}
Пример #2
0
//
// FadeTo
//
CCFadeTo* CCFadeTo::create(float duration, CCubyte opacity)
{
	CCFadeTo *pFadeTo = new CCFadeTo();
	pFadeTo->initWithDuration(duration, opacity);
	pFadeTo->autorelease();

	 return pFadeTo;
}
CCObject* CCFadeTo::copyWithZone(CCZone *pZone)
{
	CCZone* pNewZone = NULL;
	CCFadeTo* pCopy = NULL;
	if(pZone && pZone->m_pCopyObject) 
	{
		//in case of being called at sub class
		pCopy = (CCFadeTo*)(pZone->m_pCopyObject);
	}
	else
	{
		pCopy = new CCFadeTo();
		pZone = pNewZone = new CCZone(pCopy);
	}

	CCActionInterval::copyWithZone(pZone);

	pCopy->initWithDuration(m_fDuration, m_toOpacity);
	
	CC_SAFE_DELETE(pNewZone);
	return pCopy;
}