PuzzleSDK
NestedTest类 参考

#include <ClippingNodeTest.h>

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

Public 成员函数

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

详细描述

在文件 ClippingNodeTest.h123 行定义.

成员函数说明

◆ CREATE_FUNC()

NestedTest::CREATE_FUNC ( NestedTest  )

◆ setup()

void NestedTest::setup ( )
overridevirtual

重载 BaseClippingNodeTest .

在文件 ClippingNodeTest.cpp312 行定义.

313{
314 static int depth = 9;
315
316 Node* parent = this;
317
318 for (int i = 0; i < depth; i++) {
319
320 int size = 225 - i * (225 / (depth * 2));
321
322 auto clipper = ClippingNode::create();
323 clipper->setContentSize(Size(size, size));
324 clipper->setAnchorPoint(Vec2(0.5f, 0.5f));
325 clipper->setPosition(parent->getContentSize().width / 2, parent->getContentSize().height / 2);
326 clipper->setAlphaThreshold(0.05f);
327 clipper->runAction(RepeatForever::create(RotateBy::create(i % 3 ? 1.33f : 1.66f, i % 2 ? 90.0f : -90.0f)));
328 parent->addChild(clipper);
329
330 auto stencil = Sprite::create(s_pathGrossini);
331 stencil->setScale( 2.5f - (i * (2.5f / depth)) );
332 stencil->setAnchorPoint( Vec2(0.5f, 0.5f) );
333 stencil->setPosition(clipper->getContentSize().width / 2, clipper->getContentSize().height / 2);
334 stencil->setVisible(false);
335 stencil->runAction(Sequence::createWithTwoActions(DelayTime::create(i), Show::create()));
336 clipper->setStencil(stencil);
337
338 clipper->addChild(stencil);
339
340 parent = clipper;
341 }
342
343}
static const char s_pathGrossini[]
Definition: testResource.h:28

引用了 s_pathGrossini.

◆ subtitle()

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

重载 TestCase .

在文件 ClippingNodeTest.cpp307 行定义.

308{
309 return "Nest 9 Clipping Nodes, max is usually 8";
310}

◆ title()

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

重载 BaseClippingNodeTest .

在文件 ClippingNodeTest.cpp302 行定义.

303{
304 return "Nested Test";
305}

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