PuzzleSDK
LayerTestBlend类 参考

#include <LayerTest.h>

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

Public 成员函数

 CREATE_FUNC (LayerTestBlend)
 
 LayerTestBlend ()
 
void newBlend (float dt)
 
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
 
virtual void onEnter () override
 

额外继承的成员函数

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

构造及析构函数说明

◆ LayerTestBlend()

LayerTestBlend::LayerTestBlend ( )

在文件 LayerTest.cpp481 行定义.

482{
483 auto s = Director::getInstance()->getWinSize();
484 auto layer1 = LayerColor::create( Color4B(255, 255, 255, 80) );
485
486 auto sister1 = Sprite::create(s_pathSister1);
487 auto sister2 = Sprite::create(s_pathSister2);
488
489 addChild(sister1);
490 addChild(sister2);
491 addChild(layer1, 100, kTagLayer);
492
493 sister1->setPosition( Vec2( s.width*1/3, s.height/2) );
494 sister2->setPosition( Vec2( s.width*2/3, s.height/2) );
495
496 schedule( CC_SCHEDULE_SELECTOR(LayerTestBlend::newBlend), 1.0f);
497}
@ kTagLayer
Definition: LayerTest.cpp:33
void newBlend(float dt)
Definition: LayerTest.cpp:499
static const char s_pathSister1[]
Definition: testResource.h:29
static const char s_pathSister2[]
Definition: testResource.h:30

引用了 kTagLayer, newBlend(), s_pathSister1 , 以及 s_pathSister2.

+ 函数调用图:

成员函数说明

◆ CREATE_FUNC()

LayerTestBlend::CREATE_FUNC ( LayerTestBlend  )

◆ newBlend()

void LayerTestBlend::newBlend ( float  dt)

在文件 LayerTest.cpp499 行定义.

500{
501 auto layer = (LayerColor*)getChildByTag(kTagLayer);
502
503 backend::BlendFactor src;
504 backend::BlendFactor dst;
505
506 if( layer->getBlendFunc().dst == backend::BlendFactor::ZERO )
507 {
508 src = backend::BlendFactor::SRC_ALPHA;
509 dst = backend::BlendFactor::ONE_MINUS_SRC_ALPHA;
510 }
511 else
512 {
513 src = backend::BlendFactor::ONE_MINUS_DST_COLOR;
514 dst = backend::BlendFactor::ZERO;
515 }
516
517 BlendFunc bf = {src, dst};
518 layer->setBlendFunc( bf );
519}

引用了 kTagLayer.

被这些函数引用 LayerTestBlend().

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

◆ subtitle()

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

重载 TestCase .

在文件 LayerTest.cpp522 行定义.

523{
524 return "ColorLayer: blend";
525}

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