PuzzleSDK
NodeToWorld类 参考

#include <NodeTest.h>

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

Public 成员函数

 CREATE_FUNC (NodeToWorld)
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 TestCocosNodeDemo
virtual std::string title () 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 成员函数

 NodeToWorld ()
 
- Protected 成员函数 继承自 TestCocosNodeDemo
 TestCocosNodeDemo ()
 
virtual ~TestCocosNodeDemo ()
 

额外继承的成员函数

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

详细描述

在文件 NodeTest.h139 行定义.

构造及析构函数说明

◆ NodeToWorld()

NodeToWorld::NodeToWorld ( )
protected

在文件 NodeTest.cpp473 行定义.

474{
475 //
476 // This code tests that nodeToParent works OK:
477 // - It tests different anchor Points
478 // - It tests different children anchor points
479
480 auto back = Sprite::create(s_back3);
481 addChild( back, -10);
482 back->setAnchorPoint( Vec2(0,0) );
483 auto backSize = back->getContentSize();
484
485 auto item = MenuItemImage::create(s_PlayNormal, s_PlaySelect);
486 auto menu = Menu::create(item, nullptr);
487 menu->alignItemsVertically();
488 menu->setPosition( Vec2(backSize.width/2, backSize.height/2));
489 back->addChild(menu);
490
491 auto rot = RotateBy::create(5.0f, 360.0f);
492 auto fe = RepeatForever::create( rot);
493 item->runAction( fe );
494
495 auto move = MoveBy::create(3.0f, Vec2(200.0f,0.0f));
496 auto move_back = move->reverse();
497 auto seq = Sequence::create( move, move_back, nullptr);
498 auto fe2 = RepeatForever::create(seq);
499 back->runAction(fe2);
500}
static const char s_PlaySelect[]
Definition: testResource.h:48
static const char s_back3[]
Definition: testResource.h:41
static const char s_PlayNormal[]
Definition: testResource.h:47

引用了 s_back3, s_PlayNormal , 以及 s_PlaySelect.

成员函数说明

◆ CREATE_FUNC()

NodeToWorld::CREATE_FUNC ( NodeToWorld  )

◆ subtitle()

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

重载 TestCase .

在文件 NodeTest.cpp502 行定义.

503{
504 return "nodeToParent transform";
505}

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