#include <LayerTest.h>
◆ CREATE_FUNC()
◆ onEnter()
| void LayerIgnoreAnchorPointRot::onEnter |
( |
| ) |
|
|
overridevirtual |
重载 TestCase .
在文件 LayerTest.cpp 第 657 行定义.
660 auto s = Director::getInstance()->getWinSize();
662 auto l = LayerColor::create(Color4B(255, 0, 0, 255), 200, 200);
664 l->setAnchorPoint(Vec2(0.5f, 0.5f));
665 l->setPosition(Vec2( s.width/2, s.height/2));
669 auto rot = RotateBy::create(2, 360);
670 l->runAction(RepeatForever::create(rot));
673 auto child = Sprite::create(
"Images/grossini.png");
675 auto lsize = l->getContentSize();
676 child->setPosition(Vec2(lsize.width/2, lsize.height/2));
680 auto menu = Menu::create(item,
nullptr);
681 this->addChild(menu);
683 menu->setPosition(Vec2(s.width/2, s.height/2));
#define kLayerIgnoreAnchorPoint
void onToggle(cocos2d::Ref *pObject)
virtual void onEnter() override
引用了 kLayerIgnoreAnchorPoint, TestCase::onEnter() , 以及 onToggle().
◆ onToggle()
| void LayerIgnoreAnchorPointRot::onToggle |
( |
cocos2d::Ref * |
pObject | ) |
|
◆ subtitle()
| std::string LayerIgnoreAnchorPointRot::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string LayerIgnoreAnchorPointRot::title |
( |
| ) |
const |
|
overridevirtual |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/LayerTest/LayerTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/LayerTest/LayerTest.cpp