本文整理汇总了C++中CCAnimation::initWithName方法的典型用法代码示例。如果您正苦于以下问题:C++ CCAnimation::initWithName方法的具体用法?C++ CCAnimation::initWithName怎么用?C++ CCAnimation::initWithName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCAnimation
的用法示例。
在下文中一共展示了CCAnimation::initWithName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadResource
void BlockManager::loadResource()
{
CHAR szTemp[128] = {0};
CCAnimation* Ani = new CCAnimation;
m_pBgaSprite = CCSprite::spriteWithTexture(ResourceManager::sharedManager()->getMap(67));
m_pBgaSprite->setAnchorPoint(ccp(0,0));
m_pBgaSprite->setPosition(ccp(-1000,-1000));
m_pGround->addChild(m_pBgaSprite);
Ani->initWithName("TILE");
for(int i=0; i<6; i++)
{
sprintf_s(szTemp, "Tile/Tile_Ground_%d.png",i);
Ani->addFrameWithFileName(szTemp);
}
m_pBlockSprite = new CCSprite;
m_pBlockSprite->init();
m_pBlockSprite->setAnchorPoint(ccp(0,0));
m_pBlockSprite->addAnimation(Ani);
m_pBlockSprite->setIsVisible(false);
m_pBlockSprite->setPosition(ccp(-1000,-1000));
m_pGround->addChild(m_pBlockSprite);
m_bLoaded = true;
m_bLook = false;
m_pBlock = new Object_block;
m_pBlock->initWithBlock();
}
示例2: animationWithName
CCAnimation* CCAnimation::animationWithName(const char *pszName, float fDelay, CCMutableArray<CCSpriteFrame*> *pFrames)
{
CCAnimation *pAnimation = new CCAnimation();
pAnimation->initWithName(pszName, fDelay, pFrames);
pAnimation->autorelease();
return pAnimation;
}
示例3: CGRect
Portrait::Portrait()
{
CCSprite::init();
CCTexture2D *portaits = Manager_Resource::getInstance()->getResourceWithString("portrait");
CCAnimation *pPA = new CCAnimation;
pPA->initWithName("PORTRAIT");
pPA->addFrameWithTexture(portaits, CGRect(0, 0, 1, 1));
for (int n = 0; n < MAX_CHARACTER_NUMBER+1; n++)
{
pPA->addFrameWithTexture(portaits, CGRect(226*(n%8),(n/8) * 482 , 224, 480));
}
this->addAnimation(pPA);
}