本文整理汇总了C++中ActionFrame::getAction方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionFrame::getAction方法的具体用法?C++ ActionFrame::getAction怎么用?C++ ActionFrame::getAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionFrame
的用法示例。
在下文中一共展示了ActionFrame::getAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getUnitTime
CCSpawn * ActionNode::refreshActionProperty()
{
if ( m_Object == NULL )
{
return NULL;
}
CCArray* cSpawnArray = CCArray::create();
for (int n = 0; n < frameArrayNum; n++)
{
CCArray* cArray = (CCArray*)(m_FrameArray->objectAtIndex(n));
if (cArray == NULL || cArray->count() <= 0)
{
continue;
}
CCArray* cSequenceArray = CCArray::create();
int frameCount = cArray->count();
for (int i = 0; i < frameCount; i++)
{
ActionFrame* frame = (ActionFrame*)(cArray->objectAtIndex(i));
if (i == 0)
{
CCAction* cAction = frame->getAction(0);
cSequenceArray->addObject(cAction);
}
else
{
ActionFrame* srcFrame = (ActionFrame*)(cArray->objectAtIndex(i-1));
float duration = (frame->getFrameIndex() - srcFrame->getFrameIndex()) * getUnitTime();
CCAction* cAction = frame->getAction(duration,srcFrame);
cSequenceArray->addObject(cAction);
}
}
CCSequence* cSequence = CCSequence::create(cSequenceArray);
if (cSequence != NULL)
{
cSpawnArray->addObject(cSequence);
}
}
if (m_action == NULL)
{
CC_SAFE_RELEASE_NULL(m_actionSpawn);
}
else
{
CC_SAFE_RELEASE_NULL(m_action);
}
m_actionSpawn = CCSpawn::create(cSpawnArray);
CC_SAFE_RETAIN(m_actionSpawn);
return m_actionSpawn;
}