关闭

4.5兼模拟卡牌动作和动作组合

384人阅读 评论(0) 收藏 举报

scaleto,以原型为基准变到多少倍

scaleby,以当前为基准变多少倍

setScale(xf)直接定位X倍大小

 

#define TAG_SPRITE2要在头文件声明

this->addChild(sprite2, 10, TAG_SPRITE2);//第二个参数是层数,(即高层会遮盖底层,亦可理解为Z轴),第三个是类似于标签的东西

CCSprite* sprite2 = (CCSprite*)this->getChildByTag(TAG_SPRITE2);//TAG的用法

 

//模拟卡牌移动

/*CC_BREAK_IF(!CCLayer::init());



CCSize visibleSize=CCDirector::sharedDirector()->getVisibleSize();



CCSprite* sunny=CCSprite::create("sprite.png");

sunny->setPosition(ccp(50,visibleSize.height/2));

this->addChild(sunny);



CCScaleTo* a=CCScaleTo::create(0.05f,2.0f,2.0f);

CCScaleBy* b=CCScaleBy::create(0.05f,0.5f,0.5f);

CCScaleBy* f=CCScaleBy::create(0.1f,1.0f,1.0f);

CCMoveBy* c=CCMoveBy::create(10.0f,ccp(300,0));

CCSequence* d=CCSequence::create(a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,
a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,
a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,
a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,
a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,a,b,f,NULL);

CCAction* e=CCSpawn::create(c,d,NULL);




sunny->runAction(e);*/


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:3733次
    • 积分:117
    • 等级:
    • 排名:千里之外
    • 原创:8篇
    • 转载:4篇
    • 译文:0篇
    • 评论:0条