本文整理汇总了C++中CCScaleBy::reverse方法的典型用法代码示例。如果您正苦于以下问题:C++ CCScaleBy::reverse方法的具体用法?C++ CCScaleBy::reverse怎么用?C++ CCScaleBy::reverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCScaleBy
的用法示例。
在下文中一共展示了CCScaleBy::reverse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEnter
//------------------------------------------------------------------
//
// TextureGlRepeat
//
//------------------------------------------------------------------
void TextureGlRepeat::onEnter()
{
TextureDemo::onEnter();
CCSize size = CCDirector::sharedDirector()->getWinSize();
// The .png image MUST be power of 2 in order to create a continue effect.
// eg: 32x64, 512x128, 256x1024, 64x64, etc..
CCSprite *sprite = CCSprite::spriteWithFile("Images/pattern1.png", CCRectMake(0, 0, 4096, 4096));
addChild(sprite, -1, kTagSprite1);
sprite->setPosition(ccp(size.width/2,size.height/2));
ccTexParams params = {CC_LINEAR,CC_LINEAR,CC_REPEAT,CC_REPEAT};
sprite->getTexture()->setTexParameters(¶ms);
CCRotateBy* rotate = CCRotateBy::actionWithDuration(4, 360);
sprite->runAction(rotate);
CCScaleBy* scale = CCScaleBy::actionWithDuration(2, 0.04f);
CCScaleBy* scaleBack = (CCScaleBy*) (scale->reverse());
CCFiniteTimeAction* seq = CCSequence::actions(scale, scaleBack, NULL);
sprite->runAction(seq);
}
示例2: showStarsFadeEffect
void IOSStoreLayer::showStarsFadeEffect(CCNode* pBox)
{
int iStarCount = 8;
CCPointArray* pPointArray = randStarPoint(iStarCount);
for (int i = 0; i < iStarCount; ++i)
{
CCSprite* pStar = CCSprite::create(ResManager::getManager()->getSharedFilePath(g_storelayerPath+"daoju_baoxiang_xiaoguo_2.png").c_str());
pStar->setScale(this->randScale());
pStar->setRotation(this->randRotation());
pBox->addChild(pStar);
CCPoint point = pPointArray->getControlPointAtIndex(i);
pStar->setPosition(ccp(point.x , point.y));
pStar->setTag(box_star_tag);
float dt = CCRANDOM_0_1() + 1.0f;
float scale = CCRANDOM_0_1() + 0.5f;
pStar->runAction(CCRepeatForever::create(CCSequence::create(CCFadeOut::create(dt), CCFadeIn::create(dt), NULL)));
CCScaleBy* pscaleby = CCScaleBy::create(dt, scale);
pStar->runAction(CCRepeatForever::create(CCSequence::create(pscaleby, pscaleby->reverse(), NULL)));
}
}
示例3: onEnter
//------------------------------------------------------------------
//
// TextureAlias
//
//------------------------------------------------------------------
void TextureAlias::onEnter()
{
TextureDemo::onEnter();
CCSize s = CCDirector::sharedDirector()->getWinSize();
//
// Sprite 1: GL_LINEAR
//
// Default filter is GL_LINEAR
CCSprite *sprite = CCSprite::spriteWithFile("Images/grossinis_sister1.png");
sprite->setPosition(ccp( s.width/3.0f, s.height/2.0f));
addChild(sprite);
// this is the default filterting
sprite->getTexture()->setAntiAliasTexParameters();
//
// Sprite 1: GL_NEAREST
//
CCSprite *sprite2 = CCSprite::spriteWithFile("Images/grossinis_sister2.png");
sprite2->setPosition(ccp( 2*s.width/3.0f, s.height/2.0f));
addChild(sprite2);
// Use Nearest in this one
sprite2->getTexture()->setAliasTexParameters();
// scale them to show
CCScaleBy* sc = CCScaleBy::actionWithDuration(3, 8.0f);
CCScaleBy* sc_back = (CCScaleBy*) (sc->reverse());
CCRepeatForever* scaleforever = CCRepeatForever::actionWithAction((CCActionInterval*) (CCSequence::actions(sc, sc_back, NULL)));
CCRepeatForever* scaleToo = (CCRepeatForever*) (scaleforever->copy());
scaleToo->autorelease();
sprite2->runAction(scaleforever);
sprite->runAction(scaleToo);
CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo();
}
示例4: CCLOG
//------------------------------------------------------------------
//
// TileMapTest
//
//------------------------------------------------------------------
TileMapTest::TileMapTest()
{
CCTileMapAtlas* map = CCTileMapAtlas::create(s_TilesPng, s_LevelMapTga, 16, 16);
// Convert it to "alias" (GL_LINEAR filtering)
map->getTexture()->setAntiAliasTexParameters();
CCSize s = map->getContentSize();
CCLOG("ContentSize: %f, %f", s.width,s.height);
// If you are not going to use the Map, you can free it now
// NEW since v0.7
map->releaseMap();
addChild(map, 0, kTagTileMap);
map->setAnchorPoint( ccp(0, 0.5f) );
CCScaleBy *scale = CCScaleBy::create(4, 0.8f);
CCActionInterval *scaleBack = scale->reverse();
CCFiniteTimeAction* seq = CCSequence::create(scale, scaleBack, NULL);
map->runAction(CCRepeatForever::create((CCActionInterval *)seq));
}
示例5: actionScale
CCAction* BasicTest::actionScale()
{
CCScaleBy *scale = CCScaleBy::create(1.33f, 1.5f);
return CCRepeatForever::create(CCSequence::create(scale, scale->reverse(), NULL));
}