PuzzleSDK
TextureAlias类 参考

#include <Texture2dTest.h>

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

Public 成员函数

 CREATE_FUNC (TextureAlias)
 
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.h377 行定义.

成员函数说明

◆ CREATE_FUNC()

TextureAlias::CREATE_FUNC ( TextureAlias  )

◆ onEnter()

void TextureAlias::onEnter ( )
overridevirtual

重载 TextureDemo .

在文件 Texture2dTest.cpp1277 行定义.

1278{
1280 auto s = Director::getInstance()->getWinSize();
1281
1282 //
1283 // Sprite 1: GL_LINEAR
1284 //
1285 // Default filter is GL_LINEAR
1286
1287 auto sprite = Sprite::create("Images/grossinis_sister1.png");
1288 sprite->setPosition(Vec2( s.width/3.0f, s.height/2.0f));
1289 addChild(sprite);
1290
1291 // this is the default filtering
1292 sprite->getTexture()->setAntiAliasTexParameters();
1293
1294 //
1295 // Sprite 1: GL_NEAREST
1296 //
1297
1298 auto sprite2 = Sprite::create("Images/grossinis_sister2.png");
1299 sprite2->setPosition(Vec2( 2*s.width/3.0f, s.height/2.0f));
1300 addChild(sprite2);
1301
1302 // Use Nearest in this one
1303 sprite2->getTexture()->setAliasTexParameters();
1304
1305 // scale them to show
1306 auto sc = ScaleBy::create(3, 8.0f);
1307 auto sc_back = sc->reverse();
1308 auto scaleforever = RepeatForever::create(Sequence::create(sc, sc_back, nullptr));
1309 auto scaleToo = scaleforever->clone();
1310
1311 sprite2->runAction(scaleforever);
1312 sprite->runAction(scaleToo);
1313 log("%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str());
1314}
virtual void onEnter() override

引用了 TextureDemo::onEnter().

+ 函数调用图:

◆ subtitle()

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

重载 TestCase .

在文件 Texture2dTest.cpp1321 行定义.

1322{
1323 return "Left image is antialiased. Right image is aliases";
1324}

◆ title()

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

重载 TestCase .

在文件 Texture2dTest.cpp1316 行定义.

1317{
1318 return "AntiAlias / Alias textures";
1319}

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