PuzzleSDK
Issue1358类 参考

#include <MotionStreakTest.h>

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

Public 成员函数

 CREATE_FUNC (Issue1358)
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
virtual void onEnter () override
 
virtual void update (float dt) override
 
- Public 成员函数 继承自 MotionStreakTest
 MotionStreakTest ()
 
 ~MotionStreakTest ()
 
void modeCallback (cocos2d::Ref *sender)
 
- 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
 

Private 属性

cocos2d::Vec2 _center
 
float _radius
 
float _angle
 

额外继承的成员函数

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

详细描述

在文件 MotionStreakTest.h75 行定义.

成员函数说明

◆ CREATE_FUNC()

Issue1358::CREATE_FUNC ( Issue1358  )

◆ onEnter()

void Issue1358::onEnter ( )
overridevirtual

重载 MotionStreakTest .

在文件 MotionStreakTest.cpp172 行定义.

173{
175
176 // ask director the the window size
177 auto size = Director::getInstance()->getWinSize();
178
179 _streak = MotionStreak::create(2.0f, 1.0f, 50.0f, Color3B(255, 255, 0), "Images/Icon.png");
180 addChild(_streak);
181
182
183 _center = Vec2(size.width/2, size.height/2);
184 _radius = size.width/3;
185 _angle = 0.0f;
186
187 schedule(CC_SCHEDULE_SELECTOR(Issue1358::update), 0);
188}
cocos2d::Vec2 _center
virtual void update(float dt) override
virtual void onEnter() override
cocos2d::MotionStreak * _streak

引用了 _angle, _center, _radius, MotionStreakTest::_streak, MotionStreakTest::onEnter() , 以及 update().

+ 函数调用图:

◆ subtitle()

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

重载 MotionStreakTest .

在文件 MotionStreakTest.cpp202 行定义.

203{
204 return "The tail should use the texture";
205}

◆ title()

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

重载 MotionStreakTest .

在文件 MotionStreakTest.cpp197 行定义.

198{
199 return "Issue 1358";
200}

◆ update()

void Issue1358::update ( float  dt)
overridevirtual

在文件 MotionStreakTest.cpp190 行定义.

191{
192 _angle += 1.0f;
193 _streak->setPosition(Vec2(_center.x + cosf(_angle/180 * M_PI)*_radius,
194 _center.y + sinf(_angle/ 180 * M_PI)*_radius));
195}

引用了 _angle, _center, _radius , 以及 MotionStreakTest::_streak.

被这些函数引用 onEnter().

+ 这是这个函数的调用关系图:

类成员变量说明

◆ _angle

float Issue1358::_angle
private

在文件 MotionStreakTest.h87 行定义.

被这些函数引用 onEnter() , 以及 update().

◆ _center

cocos2d::Vec2 Issue1358::_center
private

在文件 MotionStreakTest.h85 行定义.

被这些函数引用 onEnter() , 以及 update().

◆ _radius

float Issue1358::_radius
private

在文件 MotionStreakTest.h86 行定义.

被这些函数引用 onEnter() , 以及 update().


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