Cocos2d-x v3.x … アクション系。さっと動きを確認して流そう。
今回のチュートリアル … Place, ScaleBy/ScaleTo, RotateBy/RotateTo
Cocos2d-x v3 C++ Tutorial 12 – Positioning Using Place
https://www.youtube.com/watch?v=KvYRlTxxOWI
Cocos2d-x v3 C++ Tutorial 13 – Scaling Using ScaleBy
https://www.youtube.com/watch?v=MTqymJh1_Qk
Cocos2d-x v3 C++ Tutorial 14 – Scaling Using ScaleTo
https://www.youtube.com/watch?v=FQYkNHug6e4
Cocos2d-x v3 C++ Tutorial 15 – Rotating Using RotateBy
https://www.youtube.com/watch?v=TrC7Ra94uTI
Cocos2d-x v3 C++ Tutorial 16 – Rotating Using RotateTo
https://www.youtube.com/watch?v=GetsCOiHk_Y
えーい、まとめてテストww ^^
Size visibleSize = Director::getInstance()->getVisibleSize(); Point origin = Director::getInstance()->getVisibleOrigin(); { auto sprite = Sprite::create("CloseNormal.png"); auto position = (Point(visibleSize) * 0.5f) + origin; sprite->setPosition(position); this->addChild(sprite, 0); //Tutorial 12-16 { auto action = Sequence::create(DelayTime::create(1.5f), //Tutorial 12 Place::create(Point(50.0f, 250.0f)), //Tutorial 13, ScaleBy::create(1.5f, 3.0f), //Tutorial 14 ScaleTo::create(1.5f, 1.5f), //Tutorial 15 RotateBy::create(1.5f, 90), //RotateBy::create(3.0f, 90, -90), //Tutorial 16 RotateTo::create(3.0f, -90.0f), //RotateTo::create(3.0f, -90.0f, 90.0f), NULL); sprite->runAction(action); } }
RotateBy/RotateTo で X,Y 別々に指定するタイプがある事は知らなかった ^^;
でも使い道がわからなかったので後々勉強… ^^;