PuzzleSDK
LayerBug3162B类 参考

#include <LayerTest.h>

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

Public 成员函数

 CREATE_FUNC (LayerBug3162B)
 
virtual void onEnter () override
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
void step (float dt)
 
- 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
 

Private 属性

cocos2d::LayerColor * _layer [3]
 

额外继承的成员函数

- 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.h198 行定义.

成员函数说明

◆ CREATE_FUNC()

LayerBug3162B::CREATE_FUNC ( LayerBug3162B  )

◆ onEnter()

void LayerBug3162B::onEnter ( )
overridevirtual

重载 TestCase .

在文件 LayerTest.cpp831 行定义.

832{
834
835 Size size = VisibleRect::getVisibleRect().size;
836 size.width = size.width / 2;
837 size.height = size.height / 3;
838 Color4B color[3] = {Color4B(200, 0, 0, 255), Color4B(150, 0, 0, 255), Color4B(100, 0, 0, 255)};
839
840 for (int i = 0; i < 3; ++i)
841 {
842 _layer[i] = LayerColor::create(color[i]);
843 _layer[i]->setContentSize(size);
844 _layer[i]->setPosition(Vec2(size.width/2, size.height/2) - Vec2(20.0f, 20.0f));
845 //_layer[i]->setOpacity(150);
846 if (i > 0)
847 {
848 _layer[i-1]->addChild(_layer[i]);
849 }
850 }
851
852 this->addChild(_layer[0]);
853
854 _layer[0]->setCascadeColorEnabled(true);
855 _layer[1]->setCascadeColorEnabled(true);
856 _layer[2]->setCascadeColorEnabled(true);
857
858 schedule(CC_SCHEDULE_SELECTOR(LayerBug3162B::step), 0.5, CC_REPEAT_FOREVER, 0);
859}
void step(float dt)
Definition: LayerTest.cpp:861
cocos2d::LayerColor * _layer[3]
Definition: LayerTest.h:209
virtual void onEnter() override
Definition: BaseTest.cpp:430
static cocos2d::Rect getVisibleRect()
Definition: VisibleRect.cpp:39

引用了 _layer, VisibleRect::getVisibleRect(), TestCase::onEnter() , 以及 step().

+ 函数调用图:

◆ step()

void LayerBug3162B::step ( float  dt)

在文件 LayerTest.cpp861 行定义.

862{
863 _layer[0]->setCascadeColorEnabled(!_layer[0]->isCascadeColorEnabled());
864}

引用了 _layer.

被这些函数引用 onEnter().

+ 这是这个函数的调用关系图:

◆ subtitle()

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

重载 TestCase .

在文件 LayerTest.cpp871 行定义.

872{
873 return "u and m layer color is effected/diseffected with b layer";
874}

◆ title()

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

重载 LayerTest .

在文件 LayerTest.cpp866 行定义.

867{
868 return "Bug 3162 bottom layer cascade color enable/disable";
869}

类成员变量说明

◆ _layer

cocos2d::LayerColor* LayerBug3162B::_layer[3]
private

在文件 LayerTest.h209 行定义.

被这些函数引用 onEnter() , 以及 step().


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