PuzzleSDK
Issue12226类 参考

#include <MotionStreakTest.h>

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

Public 成员函数

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

额外继承的成员函数

- 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.h90 行定义.

成员函数说明

◆ CREATE_FUNC()

Issue12226::CREATE_FUNC ( Issue12226  )

◆ onEnter()

void Issue12226::onEnter ( )
overridevirtual

重载 MotionStreakTest .

在文件 MotionStreakTest.cpp213 行定义.

214{
216
217 // ask director the the window size
218 auto size = Director::getInstance()->getWinSize();
219
220 auto radius = size.width/3;
221
222 auto outer = Sprite::create("Images/grossini.png");
223 outer->setPosition(size/2);
224 addChild(outer);
225
226
227 _streak = MotionStreak::create(1.0f, 3, radius * 1.5f, Color3B(0xA0, 0xA0, 0xA0), "ccb/particle-smoke.png");
228// motionStreak->setOpacity(0x70);
229 _streak->setPosition(outer->getPosition());
230
231 this->addChild(_streak, outer->getLocalZOrder() - 1);
232
233 outer->setUserData(_streak);
234
235 const uint32_t length = (radius * 0.95);
236
237 std::function<void(float)> updateMotionStreak = [=](float dt) {
238
239 Vec2 position = Vec2(outer->getPositionX() + length * cosf(-1 * CC_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f)),
240 outer->getPositionY() + length * sinf(-1 * CC_DEGREES_TO_RADIANS(outer->getRotation() + 90.0f)));
241
242 _streak->setPosition(position);
243 };
244
245 outer->schedule(updateMotionStreak, 1 / 240.0f, CC_REPEAT_FOREVER, 0, "motion1scheduler");
246
247 auto rot = RotateBy::create(2, 360);
248 auto forever = RepeatForever::create(rot);
249 outer->runAction(forever);
250
251}
virtual void onEnter() override
cocos2d::MotionStreak * _streak

引用了 MotionStreakTest::_streak , 以及 MotionStreakTest::onEnter().

+ 函数调用图:

◆ subtitle()

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

重载 MotionStreakTest .

在文件 MotionStreakTest.cpp258 行定义.

259{
260 return "Image should look without artifacts";
261}

◆ title()

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

重载 MotionStreakTest .

在文件 MotionStreakTest.cpp253 行定义.

254{
255 return "Github Issue 12226";
256}

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