PuzzleSDK
UIS9ZOrder类 参考

#include <UIScale9SpriteTest.h>

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

Public 成员函数

 CREATE_FUNC (UIS9ZOrder)
 
virtual bool init () override
 
- Public 成员函数 继承自 UIScene
 UIScene ()
 
 ~UIScene ()
 
virtual void onEnter () override
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual std::string title () const
 
virtual std::string subtitle () const
 
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 属性 继承自 UIScene
cocos2d::Layer * _uiLayer
 
cocos2d::ui::Layout * _widget
 
cocos2d::ui::Text * _sceneTitle
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 UIScale9SpriteTest.h249 行定义.

成员函数说明

◆ CREATE_FUNC()

UIS9ZOrder::CREATE_FUNC ( UIS9ZOrder  )

◆ init()

bool UIS9ZOrder::init ( )
overridevirtual

重载 UIScene .

在文件 UIScale9SpriteTest.cpp714 行定义.

715{
716 if (UIScene::init()) {
717 SpriteFrameCache::getInstance()->addSpriteFramesWithFile(s_s9s_blocks9_plist);
718
719 auto winSize = Director::getInstance()->getWinSize();
720 float x = winSize.width / 2;
721 float y = 0 + (winSize.height / 2);
722
723 auto blocks_scaled_with_insets = ui::Scale9Sprite::createWithSpriteFrameName("blocks9r.png");
724
725 blocks_scaled_with_insets->setPosition(Vec2(x, y));
726 this->addChild(blocks_scaled_with_insets);
727
728 Sprite *normalSprite = Sprite::createWithSpriteFrameName("blocks9r.png");
729 normalSprite->setColor(Color3B::RED);
730 blocks_scaled_with_insets->addChild(normalSprite);
731
732 auto topLabel = Label::createWithSystemFont("I Must be On the Top", "Arial", 15);
733 topLabel->setPosition(Vec2(20.0f,20.0f));
734 blocks_scaled_with_insets->addChild(topLabel);
735
736 auto bottomLabel = Label::createWithSystemFont("I Must be On the Bottom", "Arial", 15);
737 bottomLabel->setPosition(Vec2(80.0f,80.0f));
738 bottomLabel->setColor(Color3B::BLUE);
739 blocks_scaled_with_insets->addChild(bottomLabel,-1);
740
741 return true;
742 }
743 return false;
744}
virtual bool init() override
Definition: UIScene.cpp:46
static const char s_s9s_blocks9_plist[]
Definition: testResource.h:68

引用了 UIScene::init() , 以及 s_s9s_blocks9_plist.

+ 函数调用图:

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