PuzzleSDK
NodeGlobalZValueTest类 参考

#include <NodeTest.h>

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

Public 成员函数

 CREATE_FUNC (NodeGlobalZValueTest)
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
virtual void update (float dt) 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 成员函数

 NodeGlobalZValueTest ()
 NodeGlobalZValueTest 更多...
 
- Protected 成员函数 继承自 TestCocosNodeDemo
 TestCocosNodeDemo ()
 
virtual ~TestCocosNodeDemo ()
 

Protected 属性

cocos2d::Sprite * _sprite
 
- Protected 属性 继承自 TestCocosNodeDemo
cocos2d::Director::Projection _preProjection
 
- 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
 

详细描述

在文件 NodeTest.h266 行定义.

构造及析构函数说明

◆ NodeGlobalZValueTest()

NodeGlobalZValueTest::NodeGlobalZValueTest ( )
protected

NodeGlobalZValueTest

在文件 NodeTest.cpp913 行定义.

914{
915 Size s = Director::getInstance()->getWinSize();
916 for (int i = 0; i < 9; i++)
917 {
918 Sprite *sprite;
919 auto parent = Node::create();
920 if(i==4) {
921 sprite = Sprite::create("Images/grossinis_sister2.png");
922 _sprite = sprite;
923 _sprite->setGlobalZOrder(-1);
924 }
925 else
926 sprite = Sprite::create("Images/grossinis_sister1.png");
927
928 parent->addChild(sprite);
929 this->addChild(parent);
930
931 float w = sprite->getContentSize().width;
932 sprite->setPosition(s.width/2 - w*0.7*(i-5), s.height/2);
933 }
934
935 this->scheduleUpdate();
936}
cocos2d::Sprite * _sprite
Definition: NodeTest.h:277

引用了 _sprite.

成员函数说明

◆ CREATE_FUNC()

NodeGlobalZValueTest::CREATE_FUNC ( NodeGlobalZValueTest  )

◆ subtitle()

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

重载 TestCase .

在文件 NodeTest.cpp955 行定义.

956{
957 return "Center Sprite should change go from foreground to background";
958}

◆ title()

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

重载 TestCocosNodeDemo .

在文件 NodeTest.cpp950 行定义.

951{
952 return "Global Z Value";
953}

◆ update()

void NodeGlobalZValueTest::update ( float  dt)
overridevirtual

在文件 NodeTest.cpp938 行定义.

939{
940 static float accum = 0;
941
942 accum += dt;
943 if( accum > 1) {
944 float z = _sprite->getGlobalZOrder();
945 _sprite->setGlobalZOrder(-z);
946 accum = 0;
947 }
948}

引用了 _sprite.

类成员变量说明

◆ _sprite

cocos2d::Sprite* NodeGlobalZValueTest::_sprite
protected

在文件 NodeTest.h277 行定义.

被这些函数引用 NodeGlobalZValueTest() , 以及 update().


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