PuzzleSDK
NewCullingTest类 参考

#include <NewRendererTest.h>

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

Public 成员函数

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
 

Protected 成员函数

 NewCullingTest ()
 
virtual ~NewCullingTest ()
 
bool onTouchBegan (cocos2d::Touch *touch, cocos2d::Event *event)
 
void onTouchMoved (cocos2d::Touch *touch, cocos2d::Event *event)
 

Protected 属性

cocos2d::Vec2 _lastPos
 
- 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
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 

详细描述

在文件 NewRendererTest.h110 行定义.

构造及析构函数说明

◆ NewCullingTest()

NewCullingTest::NewCullingTest ( )
protected

在文件 NewRendererTest.cpp363 行定义.

364{
365 Size size = Director::getInstance()->getWinSize();
366 auto sprite = Sprite::create("Images/btn-about-normal-vertical.png");
367 sprite->setRotation(5);
368 sprite->setPosition(Vec2(size.width/2,size.height/3));
369 sprite->setScale(2);
370 addChild(sprite);
371
372 auto sprite2 = Sprite::create("Images/btn-about-normal-vertical.png");
373 sprite2->setRotation(-85);
374 sprite2->setPosition(Vec2(size.width/2,size.height * 2/3));
375 sprite2->setScale(2);
376 addChild(sprite2);
377
378 auto listener = EventListenerTouchOneByOne::create();
379 listener->setSwallowTouches(true);
380
381 listener->onTouchBegan = CC_CALLBACK_2(NewCullingTest::onTouchBegan, this);
382 listener->onTouchMoved = CC_CALLBACK_2(NewCullingTest::onTouchMoved, this);
383
384 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
385
386}
void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *event)
bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event)

引用了 onTouchBegan() , 以及 onTouchMoved().

+ 函数调用图:

◆ ~NewCullingTest()

NewCullingTest::~NewCullingTest ( )
protectedvirtual

在文件 NewRendererTest.cpp408 行定义.

409{
410
411}

成员函数说明

◆ onTouchBegan()

bool NewCullingTest::onTouchBegan ( cocos2d::Touch *  touch,
cocos2d::Event *  event 
)
protected

在文件 NewRendererTest.cpp388 行定义.

389{
390 auto pos = touch->getLocation();
391 _lastPos = pos;
392 return true;
393}
cocos2d::Vec2 _lastPos

引用了 _lastPos.

被这些函数引用 NewCullingTest().

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

◆ onTouchMoved()

void NewCullingTest::onTouchMoved ( cocos2d::Touch *  touch,
cocos2d::Event *  event 
)
protected

在文件 NewRendererTest.cpp395 行定义.

396{
397 auto pos = touch->getLocation();
398
399 auto offset = pos - _lastPos;
400
401 auto layerPos = getPosition();
402 auto newPos = layerPos + offset;
403
404 setPosition(newPos);
405 _lastPos = pos;
406}

引用了 _lastPos.

被这些函数引用 NewCullingTest().

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

◆ subtitle()

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

重载 MultiSceneTest .

在文件 NewRendererTest.cpp418 行定义.

419{
420 return "Drag the layer to test the result of culling";
421}

◆ title()

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

重载 MultiSceneTest .

在文件 NewRendererTest.cpp413 行定义.

414{
415 return "New Render";
416}

类成员变量说明

◆ _lastPos

cocos2d::Vec2 NewCullingTest::_lastPos
protected

在文件 NewRendererTest.h123 行定义.

被这些函数引用 onTouchBegan() , 以及 onTouchMoved().


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