Exemplo n.º 1
0
Action* RotateBy::copy () 
{
	RotateBy* rotateBy = new RotateBy(rotation, duration);
	if (NULL != interpolator) 
    rotateBy->setInterpolator( interpolator->copy());
	return rotateBy;
}
Exemplo n.º 2
0
RotateBy* RotateBy::create(float fDuration, float fDeltaAngleX, float fDeltaAngleY)
{
    RotateBy *pRotateBy = new RotateBy();
    pRotateBy->initWithDuration(fDuration, fDeltaAngleX, fDeltaAngleY);
    pRotateBy->autorelease();
    
    return pRotateBy;
}
Exemplo n.º 3
0
RotateBy* RotateBy::create(float rotate_x, float rotate_y, float rotate_z, long _time)
{
	RotateBy* ret = nullptr;
	gbAlloc(ret);
	ret->m_dstRotate.x = rotate_x;
	ret->m_dstRotate.y = rotate_y;
	ret->m_dstRotate.z = rotate_z;
	ret->m_remainTimer = _time;
	ret->autorelease();
	return ret;
}
////////////////////////////////////////////////////////
//
// For test functions
//
////////////////////////////////////////////////////////
void performanceActions(Sprite* pSprite)
{
    Size size = Director::sharedDirector()->getWinSize();
    pSprite->setPosition(ccp((rand() % (int)size.width), (rand() % (int)size.height)));

    float period = 0.5f + (rand() % 1000) / 500.0f;
    RotateBy* rot = RotateBy::create(period, 360.0f * CCRANDOM_0_1());
    ActionInterval* rot_back = rot->reverse();
    Action *permanentRotation = RepeatForever::create(Sequence::create(rot, rot_back, NULL));
    pSprite->runAction(permanentRotation);

    float growDuration = 0.5f + (rand() % 1000) / 500.0f;
    ActionInterval *grow = ScaleBy::create(growDuration, 0.5f, 0.5f);
    Action *permanentScaleLoop = RepeatForever::create(Sequence::create(grow, grow->reverse(), NULL));
    pSprite->runAction(permanentScaleLoop);
}
Exemplo n.º 5
0
gdx::Action* RotateBy::copy () {
    RotateBy* rotateBy = RotateBy::build(rotation, duration);
    if (interpolator != NULL) rotateBy->setInterpolator(interpolator->copy());
    return rotateBy;
}