#include <Sprite3DTest.h>
◆ Sprite3DBasicTest()
| Sprite3DBasicTest::Sprite3DBasicTest |
( |
| ) |
|
在文件 Sprite3DTest.cpp 第 158 行定义.
160 auto listener = EventListenerTouchAllAtOnce::create();
162 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener,
this);
164 auto s = Director::getInstance()->getWinSize();
void addNewSpriteWithCoords(cocos2d::Vec2 p)
void onTouchesEnded(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
引用了 addNewSpriteWithCoords() , 以及 onTouchesEnded().
◆ addNewSpriteWithCoords()
| void Sprite3DBasicTest::addNewSpriteWithCoords |
( |
cocos2d::Vec2 |
p | ) |
|
在文件 Sprite3DTest.cpp 第 168 行定义.
178 auto sprite = Sprite3D::create(
"Sprite3DTest/boss1.obj");
179 sprite->setScale(3.f);
180 sprite->setTexture(
"Sprite3DTest/boss.png");
188 sprite->setPosition(Vec2(p.x, p.y));
190 ActionInterval* action;
191 float random = CCRANDOM_0_1();
194 action = ScaleBy::create(3, 2);
195 else if (random < 0.40)
196 action = RotateBy::create(3, 360);
197 else if (random < 0.60)
198 action = Blink::create(1, 3);
199 else if (random < 0.8)
200 action = TintBy::create(2, 0, -255, -255);
202 action = FadeOut::create(2);
203 auto action_back = action->reverse();
204 auto seq = Sequence::create(action, action_back,
nullptr);
206 sprite->runAction(RepeatForever::create(seq));
被这些函数引用 onTouchesEnded() , 以及 Sprite3DBasicTest().
◆ CREATE_FUNC()
◆ onTouchesEnded()
| void Sprite3DBasicTest::onTouchesEnded |
( |
const std::vector< cocos2d::Touch * > & |
touches, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ subtitle()
| std::string Sprite3DBasicTest::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string Sprite3DBasicTest::title |
( |
| ) |
const |
|
overridevirtual |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp