PuzzleSDK
SpriteBatchNodeAnchorPoint类 参考

#include <SpriteTest.h>

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

Public 成员函数

 CREATE_FUNC (SpriteBatchNodeAnchorPoint)
 
 SpriteBatchNodeAnchorPoint ()
 
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.h222 行定义.

构造及析构函数说明

◆ SpriteBatchNodeAnchorPoint()

SpriteBatchNodeAnchorPoint::SpriteBatchNodeAnchorPoint ( )

在文件 SpriteTest.cpp1157 行定义.

1158{
1159 // small capacity. Testing resizing.
1160 // Don't use capacity=1 in your real game. It is expensive to resize the capacity
1161 auto batch = SpriteBatchNode::create("Images/grossini_dance_atlas.png", 1);
1162 addChild(batch, 0, kTagSpriteBatchNode);
1163
1164 auto s = Director::getInstance()->getWinSize();
1165
1166
1167 auto rotate = RotateBy::create(10, 360);
1168 auto action = RepeatForever::create(rotate);
1169 for(int i=0;i<3;i++)
1170 {
1171 auto sprite = Sprite::createWithTexture(batch->getTexture(), Rect(85*i, 121*1, 85, 121));
1172 sprite->setPosition( Vec2( s.width/4*(i+1), s.height/2) );
1173
1174 auto point = Sprite::create("Images/r1.png");
1175 point->setScale( 0.25f );
1176 point->setPosition( sprite->getPosition() );
1177 addChild(point, 1);
1178
1179 switch(i)
1180 {
1181 case 0:
1182 sprite->setAnchorPoint( Vec2::ANCHOR_BOTTOM_LEFT );
1183 break;
1184 case 1:
1185 sprite->setAnchorPoint( Vec2::ANCHOR_MIDDLE );
1186 break;
1187 case 2:
1188 sprite->setAnchorPoint( Vec2::ANCHOR_TOP_RIGHT );
1189 break;
1190 }
1191
1192 point->setPosition( sprite->getPosition() );
1193
1194 sprite->runAction( action->clone() );
1195 batch->addChild(sprite, i);
1196 }
1197}
@ kTagSpriteBatchNode
Definition: SpriteTest.cpp:40

引用了 kTagSpriteBatchNode.

成员函数说明

◆ CREATE_FUNC()

SpriteBatchNodeAnchorPoint::CREATE_FUNC ( SpriteBatchNodeAnchorPoint  )

◆ subtitle()

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

重载 TestCase .

在文件 SpriteTest.cpp1204 行定义.

1205{
1206 return "anchor point";
1207}

◆ title()

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

重载 TestCase .

在文件 SpriteTest.cpp1199 行定义.

1200{
1201 return "Testing SpriteBatchNode";
1202}

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