PuzzleSDK
LayerTestCascadingOpacityB类 参考

#include <LayerTest.h>

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

Public 成员函数

 CREATE_FUNC (LayerTestCascadingOpacityB)
 
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.h50 行定义.

成员函数说明

◆ CREATE_FUNC()

LayerTestCascadingOpacityB::CREATE_FUNC ( LayerTestCascadingOpacityB  )

◆ onEnter()

void LayerTestCascadingOpacityB::onEnter ( )
overridevirtual

重载 TestCase .

在文件 LayerTest.cpp127 行定义.

128{
130
131 auto s = Director::getInstance()->getWinSize();
132 auto layer1 = LayerColor::create(Color4B(192, 0, 0, 255), s.width, s.height/2);
133 layer1->setCascadeColorEnabled(false);
134
135 layer1->setPosition( Vec2(0.0f, s.height/2));
136
137 auto sister1 = Sprite::create("Images/grossinis_sister1.png");
138 auto sister2 = Sprite::create("Images/grossinis_sister2.png");
139 auto label = Label::createWithBMFont("fonts/bitmapFontTest.fnt", "Test");
140
141 layer1->addChild(sister1);
142 layer1->addChild(sister2);
143 layer1->addChild(label);
144 this->addChild( layer1, 0, kTagLayer);
145
146 sister1->setPosition( Vec2( s.width*1/3, 0.0f));
147 sister2->setPosition( Vec2( s.width*2/3, 0.0f));
148 label->setPosition( Vec2( s.width/2, 0.0f));
149
150 layer1->runAction(
151 RepeatForever::create(
152 Sequence::create(
153 FadeTo::create(4, 0),
154 FadeTo::create(4, 255),
155 DelayTime::create(1),
156 nullptr)));
157
158 sister1->runAction(
159 RepeatForever::create(
160 Sequence::create(
161 FadeTo::create(2, 0),
162 FadeTo::create(2, 255),
163 FadeTo::create(2, 0),
164 FadeTo::create(2, 255),
165 DelayTime::create(1),
166 nullptr)));
167
168 // Enable cascading in scene
169 setEnableRecursiveCascading(this, true);
170}
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 LayerTestCascadingOpacityB::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 LayerTest.cpp172 行定义.

173{
174 return "CCLayerColor: cascading opacity";
175}

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