PuzzleSDK
BillBoardRotationTest类 参考

#include <BillBoardTest.h>

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

Public 成员函数

 CREATE_FUNC (BillBoardRotationTest)
 
 BillBoardRotationTest ()
 
virtual ~BillBoardRotationTest ()
 
virtual std::string title () const override
 
virtual std::string subtitle () 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
 
virtual void onEnter () override
 

额外继承的成员函数

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

详细描述

在文件 BillBoardTest.h37 行定义.

构造及析构函数说明

◆ BillBoardRotationTest()

BillBoardRotationTest::BillBoardRotationTest ( )

在文件 BillBoardTest.cpp49 行定义.

50{
51 auto root = Sprite3D::create();
52 root->setPositionNormalized(Vec2(0.5f,0.25f));
53 addChild(root);
54
55 auto model = Sprite3D::create("Sprite3DTest/orc.c3b");
56 model->setScale(5);
57 model->setRotation3D(Vec3(0.0f,180.0f,0.0f));
58 root->addChild(model);
59
60 auto bill = BillBoard::create();
61 bill->setPosition(0, 120);
62 root->addChild(bill);
63
64 auto sp = Sprite::create("Images/SpookyPeas.png");
65 sp->setScale(2);
66 bill->addChild(sp);
67
68 auto lbl = Label::create();
69 lbl->setPosition(0.0f, 30.0f);
70 lbl->setString("+100");
71 bill->addChild(lbl);
72
73 auto r = RotateBy::create(10, Vec3(0.0f,360.0f,0.0f));
74 auto rp = RepeatForever::create(r);
75 root->runAction(rp);
76
77 auto jump = JumpBy::create(1, Vec2(0.0f, 0.0f), 30, 1);
78 auto scale = ScaleBy::create(2.f, 2.f, 2.f, 0.1f);
79 auto seq = Sequence::create(jump,scale, NULL);
80
81 auto rot = RotateBy::create(2, Vec3(-90.0f, 0.0f, 0.0f));
82 auto act = Spawn::create(seq, rot,NULL);
83
84 auto scale2 = scale->reverse();
85 auto rot2 = rot->reverse();
86 auto act2 = Spawn::create(scale2, rot2, NULL);
87
88 auto seq2 = Sequence::create(act, act2, NULL);
89 auto repeat = RepeatForever::create(seq2);
90 model->runAction(repeat);
91}

◆ ~BillBoardRotationTest()

BillBoardRotationTest::~BillBoardRotationTest ( )
virtual

在文件 BillBoardTest.cpp93 行定义.

94{
95
96}

成员函数说明

◆ CREATE_FUNC()

BillBoardRotationTest::CREATE_FUNC ( BillBoardRotationTest  )

◆ subtitle()

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

重载 TestCase .

在文件 BillBoardTest.cpp103 行定义.

104{
105 return "All the sprites should still facing camera";
106}

◆ title()

std::string BillBoardRotationTest::title ( ) const
overridevirtual

重载 TestCase .

在文件 BillBoardTest.cpp98 行定义.

99{
100 return "Rotation Test";
101}

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