PuzzleSDK
SpritePolygonTestDemo类 参考

#include <SpritePolygonTest.h>

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

Protected 成员函数

virtual bool init () override
 
virtual void initSprites ()
 
void initTouches ()
 
- Protected 成员函数 继承自 SpritePolygonTestCase
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
virtual void onEnter () override
 
virtual void onExit () override
 
 SpritePolygonTestCase ()
 
 ~SpritePolygonTestCase ()
 
void updateDrawNode ()
 

Protected 属性

cocos2d::Sprite * _polygonSprite
 
cocos2d::Sprite * _normalSprite
 
- Protected 属性 继承自 SpritePolygonTestCase
std::string _title
 
std::string _subtitle
 
bool _isDebugDraw
 
bool _isNeedDebugMenu
 
cocos2d::Vector< cocos2d::DrawNode * > _drawNodes
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- 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
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 

详细描述

在文件 SpritePolygonTest.h50 行定义.

成员函数说明

◆ init()

bool SpritePolygonTestDemo::init ( )
overrideprotectedvirtual

重载 SpritePolygonTestCase .

在文件 SpritePolygonTest.cpp140 行定义.

141{
143 _polygonSprite = nullptr;
144 initSprites();
145 initTouches();
146 return true;
147 }
148 return false;
149}
virtual bool init() override
virtual void initSprites()
cocos2d::Sprite * _polygonSprite

引用了 _polygonSprite, SpritePolygonTestCase::init(), initSprites() , 以及 initTouches().

+ 函数调用图:

◆ initSprites()

virtual void SpritePolygonTestDemo::initSprites ( )
inlineprotectedvirtual

SpritePolygonTest1, SpritePolygonTest2, SpritePolygonTestNoCrash, SpritePolygonTestTPIsland, SpritePolygonTestAutoPolyIsland, SpritePolygonTestFrameAnim , 以及 Issue14017Test 重载.

在文件 SpritePolygonTest.h56 行定义.

56{};

被这些函数引用 init().

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

◆ initTouches()

void SpritePolygonTestDemo::initTouches ( )
protected

在文件 SpritePolygonTest.cpp151 行定义.

152{
153 if(_polygonSprite) {
154 auto touchListener = EventListenerTouchOneByOne::create();
155 touchListener->onTouchBegan = [&](Touch* touch, Event* event){
156 return true;
157 };
158 touchListener->onTouchMoved = [&](Touch* touch, Event* event){
159 auto pos = touch->getDelta();
160 float newScale = clampf(_polygonSprite->getScale() + pos.x * 0.01f, 0.1f, 2.f);
161 _polygonSprite->setScale(newScale);
162 _normalSprite->setScale(newScale);
164 };
165 _eventDispatcher->addEventListenerWithSceneGraphPriority(touchListener, this);
166 }
167}
cocos2d::Sprite * _normalSprite

引用了 _normalSprite, _polygonSprite , 以及 SpritePolygonTestCase::updateDrawNode().

被这些函数引用 init().

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

类成员变量说明

◆ _normalSprite

cocos2d::Sprite* SpritePolygonTestDemo::_normalSprite
protected

◆ _polygonSprite

cocos2d::Sprite* SpritePolygonTestDemo::_polygonSprite
protected

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