PuzzleSDK
SpriteBatchNodeChildrenChildren类 参考

#include <SpriteTest.h>

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

Public 成员函数

 CREATE_FUNC (SpriteBatchNodeChildrenChildren)
 
 SpriteBatchNodeChildrenChildren ()
 
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.h617 行定义.

构造及析构函数说明

◆ SpriteBatchNodeChildrenChildren()

SpriteBatchNodeChildrenChildren::SpriteBatchNodeChildrenChildren ( )

在文件 SpriteTest.cpp3259 行定义.

3260{
3261 auto s = Director::getInstance()->getWinSize();
3262
3263 SpriteFrameCache::getInstance()->addSpriteFramesWithFile("animations/ghosts.plist");
3264
3265 SpriteBatchNode *aParent;
3266 Sprite *l1, *l2a, *l2b, *l3a1, *l3a2, *l3b1, *l3b2;
3267 auto rot = RotateBy::create(10, 360);
3268 auto seq = RepeatForever::create(rot);
3269
3270 auto rot_back = rot->reverse();
3271 auto rot_back_fe = RepeatForever::create(rot_back);
3272
3273 //
3274 // SpriteBatchNode: 3 levels of children
3275 //
3276
3277 aParent = SpriteBatchNode::create("animations/ghosts.png");
3278 //TODO: minggo
3279// aParent->getTexture()->generateMipmap();
3280 addChild(aParent);
3281
3282 // parent
3283 l1 = Sprite::createWithSpriteFrameName("father.gif");
3284 l1->setPosition( Vec2( s.width/2, s.height/2) );
3285 l1->runAction( seq->clone() );
3286 aParent->addChild(l1);
3287 auto l1Size = l1->getContentSize();
3288
3289 // child left
3290 l2a = Sprite::createWithSpriteFrameName("sister1.gif");
3291 l2a->setPosition( Vec2( -50 + l1Size.width/2, 0 + l1Size.height/2) );
3292 l2a->runAction( rot_back_fe->clone() );
3293 l1->addChild(l2a);
3294 auto l2aSize = l2a->getContentSize();
3295
3296
3297 // child right
3298 l2b = Sprite::createWithSpriteFrameName("sister2.gif");
3299 l2b->setPosition( Vec2( +50 + l1Size.width/2, 0 + l1Size.height/2) );
3300 l2b->runAction( rot_back_fe->clone() );
3301 l1->addChild(l2b);
3302 auto l2bSize = l2a->getContentSize();
3303
3304
3305 // child left bottom
3306 l3a1 = Sprite::createWithSpriteFrameName("child1.gif");
3307 l3a1->setScale( 0.45f );
3308 l3a1->setPosition( Vec2(0+l2aSize.width/2,-100+l2aSize.height/2) );
3309 l2a->addChild(l3a1);
3310
3311 // child left top
3312 l3a2 = Sprite::createWithSpriteFrameName("child1.gif");
3313 l3a2->setScale( 0.45f );
3314 l3a1->setPosition( Vec2(0+l2aSize.width/2,+100+l2aSize.height/2) );
3315 l2a->addChild(l3a2);
3316
3317 // child right bottom
3318 l3b1 = Sprite::createWithSpriteFrameName("child1.gif");
3319 l3b1->setScale( 0.45f );
3320 l3b1->setFlippedY( true );
3321 l3b1->setPosition( Vec2(0+l2bSize.width/2,-100+l2bSize.height/2) );
3322 l2b->addChild(l3b1);
3323
3324 // child right top
3325 l3b2 = Sprite::createWithSpriteFrameName("child1.gif");
3326 l3b2->setScale( 0.45f );
3327 l3b2->setFlippedY( true );
3328 l3b1->setPosition( Vec2(0+l2bSize.width/2,+100+l2bSize.height/2) );
3329 l2b->addChild(l3b2);
3330
3331}

成员函数说明

◆ CREATE_FUNC()

SpriteBatchNodeChildrenChildren::CREATE_FUNC ( SpriteBatchNodeChildrenChildren  )

◆ subtitle()

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

重载 TestCase .

在文件 SpriteTest.cpp3338 行定义.

3339{
3340 return "multiple levels of children";
3341}

◆ title()

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

重载 TestCase .

在文件 SpriteTest.cpp3333 行定义.

3334{
3335 return "Testing SpriteBatchNode";
3336}

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