PuzzleSDK
LayerIgnoreAnchorPointRot类 参考

#include <LayerTest.h>

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

Public 成员函数

 CREATE_FUNC (LayerIgnoreAnchorPointRot)
 
virtual void onEnter () override
 
void onToggle (cocos2d::Ref *pObject)
 
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
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 LayerTest
std::string _title
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 LayerTest.h155 行定义.

成员函数说明

◆ CREATE_FUNC()

LayerIgnoreAnchorPointRot::CREATE_FUNC ( LayerIgnoreAnchorPointRot  )

◆ onEnter()

void LayerIgnoreAnchorPointRot::onEnter ( )
overridevirtual

重载 TestCase .

在文件 LayerTest.cpp657 行定义.

658{
660 auto s = Director::getInstance()->getWinSize();
661
662 auto l = LayerColor::create(Color4B(255, 0, 0, 255), 200, 200);
663
664 l->setAnchorPoint(Vec2(0.5f, 0.5f));
665 l->setPosition(Vec2( s.width/2, s.height/2));
666
667 this->addChild(l, 0, kLayerIgnoreAnchorPoint);
668
669 auto rot = RotateBy::create(2, 360);
670 l->runAction(RepeatForever::create(rot));
671
672
673 auto child = Sprite::create("Images/grossini.png");
674 l->addChild(child);
675 auto lsize = l->getContentSize();
676 child->setPosition(Vec2(lsize.width/2, lsize.height/2));
677
678 auto item = MenuItemFont::create("Toggle ignore anchor point", CC_CALLBACK_1(LayerIgnoreAnchorPointRot::onToggle, this));
679
680 auto menu = Menu::create(item, nullptr);
681 this->addChild(menu);
682
683 menu->setPosition(Vec2(s.width/2, s.height/2));
684}
#define kLayerIgnoreAnchorPoint
Definition: LayerTest.cpp:606
void onToggle(cocos2d::Ref *pObject)
Definition: LayerTest.cpp:686
virtual void onEnter() override
Definition: BaseTest.cpp:430

引用了 kLayerIgnoreAnchorPoint, TestCase::onEnter() , 以及 onToggle().

+ 函数调用图:

◆ onToggle()

void LayerIgnoreAnchorPointRot::onToggle ( cocos2d::Ref *  pObject)

在文件 LayerTest.cpp686 行定义.

687{
688 auto layer = this->getChildByTag(kLayerIgnoreAnchorPoint);
689 bool ignore = layer->isIgnoreAnchorPointForPosition();
690 layer->setIgnoreAnchorPointForPosition(! ignore);
691}

引用了 kLayerIgnoreAnchorPoint.

被这些函数引用 onEnter().

+ 这是这个函数的调用关系图:

◆ subtitle()

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

重载 TestCase .

在文件 LayerTest.cpp698 行定义.

699{
700 return "Ignoring Anchor Vec2 for rotations";
701}

◆ title()

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

重载 LayerTest .

在文件 LayerTest.cpp693 行定义.

694{
695 return "IgnoreAnchorPoint - Rotation";
696}

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