PuzzleSDK
LayerBug3162A类 参考

#include <LayerTest.h>

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

Public 成员函数

 CREATE_FUNC (LayerBug3162A)
 
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.h184 行定义.

成员函数说明

◆ CREATE_FUNC()

LayerBug3162A::CREATE_FUNC ( LayerBug3162A  )

◆ onEnter()

void LayerBug3162A::onEnter ( )
overridevirtual

重载 TestCase .

在文件 LayerTest.cpp788 行定义.

789{
791
792 Size size = VisibleRect::getVisibleRect().size;
793 size.width = size.width / 2;
794 size.height = size.height / 3;
795 Color4B color[3] = {Color4B(255, 0, 0, 255), Color4B(0, 255, 0, 255), Color4B(0, 0, 255, 255)};
796
797 for (int i = 0; i < 3; ++i)
798 {
799 _layer[i] = LayerColor::create(color[i]);
800 _layer[i]->setContentSize(size);
801 _layer[i]->setPosition(Vec2(size.width/2, size.height/2) - Vec2(20.0f, 20.0f));
802 _layer[i]->setOpacity(150);
803 _layer[i]->setCascadeOpacityEnabled(true);
804 if (i > 0)
805 {
806 _layer[i-1]->addChild(_layer[i]);
807 }
808 }
809
810 this->addChild(_layer[0]);
811
812 schedule(CC_SCHEDULE_SELECTOR(LayerBug3162A::step), 0.5, CC_REPEAT_FOREVER, 0);
813}
cocos2d::LayerColor * _layer[3]
Definition: LayerTest.h:195
void step(float dt)
Definition: LayerTest.cpp:815
virtual void onEnter() override
Definition: BaseTest.cpp:430
static cocos2d::Rect getVisibleRect()
Definition: VisibleRect.cpp:39

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

+ 函数调用图:

◆ step()

void LayerBug3162A::step ( float  dt)

在文件 LayerTest.cpp815 行定义.

816{
817 _layer[0]->setCascadeOpacityEnabled(!_layer[0]->isCascadeOpacityEnabled());
818}

引用了 _layer.

被这些函数引用 onEnter().

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

◆ subtitle()

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

重载 TestCase .

在文件 LayerTest.cpp825 行定义.

826{
827 return "g and b layer opacity is effected/diseffected with r layer";
828}

◆ title()

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

重载 LayerTest .

在文件 LayerTest.cpp820 行定义.

821{
822 return "Bug 3162 red layer cascade opacity enable/disable";
823}

类成员变量说明

◆ _layer

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

在文件 LayerTest.h195 行定义.

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


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