PuzzleSDK
LayerTestCascadingOpacityA类 参考

#include <LayerTest.h>

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

Public 成员函数

 CREATE_FUNC (LayerTestCascadingOpacityA)
 
virtual void onEnter () override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 LayerTest
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
 

额外继承的成员函数

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

详细描述

在文件 LayerTest.h42 行定义.

成员函数说明

◆ CREATE_FUNC()

LayerTestCascadingOpacityA::CREATE_FUNC ( LayerTestCascadingOpacityA  )

◆ onEnter()

void LayerTestCascadingOpacityA::onEnter ( )
overridevirtual

重载 TestCase .

在文件 LayerTest.cpp78 行定义.

79{
81
82 auto s = Director::getInstance()->getWinSize();
83 auto layer1 = Layer::create();
84
85 auto sister1 = Sprite::create("Images/grossinis_sister1.png");
86 auto sister2 = Sprite::create("Images/grossinis_sister2.png");
87 auto label = Label::createWithBMFont("fonts/bitmapFontTest.fnt", "Test");
88
89 layer1->addChild(sister1);
90 layer1->addChild(sister2);
91 layer1->addChild(label);
92 this->addChild( layer1, 0, kTagLayer);
93
94 sister1->setPosition( Vec2( s.width*1/3, s.height/2));
95 sister2->setPosition( Vec2( s.width*2/3, s.height/2));
96 label->setPosition( Vec2( s.width/2, s.height/2));
97
98 layer1->runAction(
99 RepeatForever::create(
100 Sequence::create(
101 FadeTo::create(4, 0),
102 FadeTo::create(4, 255),
103 DelayTime::create(1),
104 nullptr)));
105
106 sister1->runAction(
107 RepeatForever::create(
108 Sequence::create(
109 FadeTo::create(2, 0),
110 FadeTo::create(2, 255),
111 FadeTo::create(2, 0),
112 FadeTo::create(2, 255),
113 DelayTime::create(1),
114 nullptr)));
115
116 // Enable cascading in scene
117 setEnableRecursiveCascading(this, true);
118}
static void setEnableRecursiveCascading(Node *node, bool enable)
Definition: LayerTest.cpp:61
@ kTagLayer
Definition: LayerTest.cpp:33
virtual void onEnter() override
Definition: BaseTest.cpp:430

引用了 kTagLayer, TestCase::onEnter() , 以及 setEnableRecursiveCascading().

+ 函数调用图:

◆ subtitle()

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

重载 TestCase .

在文件 LayerTest.cpp120 行定义.

121{
122 return "Layer: cascading opacity";
123}

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