PuzzleSDK
ActionBezier类 参考

#include <ActionsTest.h>

+ 类 ActionBezier 继承关系图:
+ ActionBezier 的协作图:

Public 成员函数

 CREATE_FUNC (ActionBezier)
 
virtual void onEnter () override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 ActionsDemo
virtual void onExit () override
 
void centerSprites (unsigned int numberOfSprites)
 
void alignSpritesLeft (unsigned int numberOfSprites)
 
virtual std::string title () const override
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 ActionsDemo
cocos2d::Sprite * _grossini
 
cocos2d::Sprite * _tamara
 
cocos2d::Sprite * _kathia
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 ActionsTest.h139 行定义.

成员函数说明

◆ CREATE_FUNC()

ActionBezier::CREATE_FUNC ( ActionBezier  )

◆ onEnter()

void ActionBezier::onEnter ( )
overridevirtual

重载 ActionsDemo .

在文件 ActionsTest.cpp507 行定义.

508{
510
511 auto s = Director::getInstance()->getWinSize();
512
513 //
514 // startPosition can be any coordinate, but since the movement
515 // is relative to the Bezier curve, make it (0,0)
516 //
517
518 centerSprites(3);
519
520 // sprite 1
521 ccBezierConfig bezier;
522 bezier.controlPoint_1 = Vec2(0.0f, s.height/2);
523 bezier.controlPoint_2 = Vec2(300.0f, -s.height/2);
524 bezier.endPosition = Vec2(300.0f,100.0f);
525
526 auto bezierForward = BezierBy::create(3, bezier);
527 auto bezierBack = bezierForward->reverse();
528 auto rep = RepeatForever::create(Sequence::create( bezierForward, bezierBack, nullptr));
529
530
531 // sprite 2
532 _tamara->setPosition(80,160);
533 ccBezierConfig bezier2;
534 bezier2.controlPoint_1 = Vec2(100.0f, s.height/2);
535 bezier2.controlPoint_2 = Vec2(200.0f, -s.height/2);
536 bezier2.endPosition = Vec2(240.0f,160.0f);
537
538 auto bezierTo1 = BezierTo::create(2, bezier2);
539
540 // sprite 3
541 _kathia->setPosition(400,160);
542 auto bezierTo2 = BezierTo::create(2, bezier2);
543
544 _grossini->runAction( rep);
545 _tamara->runAction(bezierTo1);
546 _kathia->runAction(bezierTo2);
547
548}
void centerSprites(unsigned int numberOfSprites)
cocos2d::Sprite * _grossini
Definition: ActionsTest.h:37
virtual void onEnter() override
cocos2d::Sprite * _tamara
Definition: ActionsTest.h:38
cocos2d::Sprite * _kathia
Definition: ActionsTest.h:39

引用了 ActionsDemo::_grossini, ActionsDemo::_kathia, ActionsDemo::_tamara, ActionsDemo::centerSprites() , 以及 ActionsDemo::onEnter().

+ 函数调用图:

◆ subtitle()

std::string ActionBezier::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 ActionsTest.cpp550 行定义.

551{
552 return "BezierBy / BezierTo";
553}

该类的文档由以下文件生成: