PuzzleSDK
NodeToWorld3D类 参考

#include <NodeTest.h>

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

Public 成员函数

 CREATE_FUNC (NodeToWorld3D)
 
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 成员函数

 NodeToWorld3D ()
 
- 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.h149 行定义.

构造及析构函数说明

◆ NodeToWorld3D()

NodeToWorld3D::NodeToWorld3D ( )
protected

在文件 NodeTest.cpp512 行定义.

513{
514 //
515 // This code tests that nodeToParent works OK:
516 // - It tests different anchor Points
517 // - It tests different children anchor points
518
519 Size s = Director::getInstance()->getWinSize();
520 auto parent = Node::create();
521 parent->setContentSize(s);
522 parent->setAnchorPoint(Vec2(0.5f, 0.5f));
523 parent->setPosition(s.width/2, s.height/2);
524 this->addChild(parent);
525
526 auto back = Sprite::create(s_back3);
527 parent->addChild( back, -10);
528 back->setAnchorPoint( Vec2(0.0f,0.0f) );
529 auto backSize = back->getContentSize();
530
531 auto item = MenuItemImage::create(s_PlayNormal, s_PlaySelect);
532 auto menu = Menu::create(item, nullptr);
533 menu->alignItemsVertically();
534 menu->setPosition( Vec2(backSize.width/2, backSize.height/2));
535 back->addChild(menu);
536
537 auto rot = RotateBy::create(5, 360);
538 auto fe = RepeatForever::create( rot);
539 item->runAction( fe );
540
541 auto move = MoveBy::create(3, Vec2(200.0f,0.0f));
542 auto move_back = move->reverse();
543 auto seq = Sequence::create( move, move_back, nullptr);
544 auto fe2 = RepeatForever::create(seq);
545 back->runAction(fe2);
546
547 auto orbit = OrbitCamera::create(10, 0, 1, 0, 360, 0, 90);
548 parent->runAction(orbit);
549}
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()

NodeToWorld3D::CREATE_FUNC ( NodeToWorld3D  )

◆ subtitle()

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

重载 TestCase .

在文件 NodeTest.cpp551 行定义.

552{
553 return "nodeToParent transform in 3D";
554}

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