PuzzleSDK
TextureBlend类 参考

#include <Texture2dTest.h>

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

Public 成员函数

 CREATE_FUNC (TextureBlend)
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
virtual void onEnter () override
 
- Public 成员函数 继承自 TextureDemo
virtual ~TextureDemo ()
 
- 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 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 Texture2dTest.h395 行定义.

成员函数说明

◆ CREATE_FUNC()

TextureBlend::CREATE_FUNC ( TextureBlend  )

◆ onEnter()

void TextureBlend::onEnter ( )
overridevirtual

重载 TextureDemo .

在文件 Texture2dTest.cpp1436 行定义.

1437{
1439
1440 for( int i=0;i < 15;i++ )
1441 {
1442 // BOTTOM sprites have alpha pre-multiplied
1443 // they use by default BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA
1444 auto cloud = Sprite::create("Images/test_blend.png");
1445 addChild(cloud, i+1, 100+i);
1446 cloud->setPosition(Vec2(50+25*i, 80));
1447 cloud->setBlendFunc( BlendFunc::ALPHA_PREMULTIPLIED );
1448
1449 // CENTER sprites have also alpha pre-multiplied
1450 // they use by default BlendFactor::SRC_ALPHA, BlendFactor::ONE_MINUS_SRC_ALPHA
1451 cloud = Sprite::create("Images/test_blend.png");
1452 addChild(cloud, i+1, 200+i);
1453 cloud->setPosition(Vec2(50+25*i, 160));
1454 BlendFunc blendFunc2 = { backend::BlendFactor::ONE_MINUS_DST_COLOR, backend::BlendFactor::ZERO };
1455 cloud->setBlendFunc(blendFunc2);
1456
1457 // UPPER sprites are using custom blending function
1458 // You can set any blend function to your sprites
1459 cloud = Sprite::create("Images/test_blend.png");
1460 addChild(cloud, i+1, 200+i);
1461 cloud->setPosition(Vec2(50+25*i, 320-80));
1462 BlendFunc blendFunc3 = { backend::BlendFactor::SRC_ALPHA, backend::BlendFactor::ONE };
1463 cloud->setBlendFunc(blendFunc3); // additive blending
1464 }
1465}
virtual void onEnter() override

引用了 TextureDemo::onEnter().

+ 函数调用图:

◆ subtitle()

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

重载 TestCase .

在文件 Texture2dTest.cpp1472 行定义.

1473{
1474 return "Testing 3 different blending modes";
1475}

◆ title()

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

重载 TestCase .

在文件 Texture2dTest.cpp1467 行定义.

1468{
1469 return "Texture Blending";
1470}

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