PuzzleSDK
SpriteSubclass类 参考

#include <SpriteTest.h>

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

Public 成员函数

 CREATE_FUNC (SpriteSubclass)
 
 SpriteSubclass ()
 
virtual std::string title () const override
 
virtual std::string subtitle () 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 属性 继承自 SpriteTestDemo
std::string _title
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 SpriteTest.h635 行定义.

构造及析构函数说明

◆ SpriteSubclass()

SpriteSubclass::SpriteSubclass ( )

在文件 SpriteTest.cpp3535 行定义.

3536{
3537 auto s = Director::getInstance()->getWinSize();
3538
3539 SpriteFrameCache::getInstance()->addSpriteFramesWithFile("animations/ghosts.plist");
3540 auto aParent = SpriteBatchNode::create("animations/ghosts.png");
3541
3542 // MySprite1
3543 MySprite1 *sprite = MySprite1::createWithSpriteFrameName("father.gif");
3544 sprite->setPosition(Vec2( s.width/4*1, s.height/2));
3545 aParent->addChild(sprite);
3546 addChild(aParent);
3547
3548 // MySprite2
3549 MySprite2 *sprite2 = MySprite2::create("Images/grossini.png");
3550 addChild(sprite2);
3551 sprite2->setPosition(Vec2(s.width/4*3, s.height/2));
3552}
static MySprite1 * createWithSpriteFrameName(const std::string &spriteFrameName)
static MySprite2 * create(const std::string &name)

引用了 MySprite2::create() , 以及 MySprite1::createWithSpriteFrameName().

+ 函数调用图:

成员函数说明

◆ CREATE_FUNC()

SpriteSubclass::CREATE_FUNC ( SpriteSubclass  )

◆ subtitle()

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

重载 TestCase .

在文件 SpriteTest.cpp3559 行定义.

3560{
3561 return "Testing initWithTexture:rect method";
3562}

◆ title()

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

重载 TestCase .

在文件 SpriteTest.cpp3554 行定义.

3555{
3556 return "Sprite subclass";
3557}

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