#include <Sprite3DTest.h>
◆ Sprite3DWithSkinOutlineTest()
| Sprite3DWithSkinOutlineTest::Sprite3DWithSkinOutlineTest |
( |
| ) |
|
在文件 Sprite3DTest.cpp 第 1010 行定义.
1012 auto listener = EventListenerTouchAllAtOnce::create();
1014 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener,
this);
1016 auto s = Director::getInstance()->getWinSize();
1019#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
1021 [
this](EventCustom*)
1023 auto material = Sprite3DMaterial::createWithFilename(
"Sprite3DTest/outline.material");
1024 material->setTechnique(
"outline_skinned");
1027 sprite->setMaterial(material->clone());
cocos2d::EventListenerCustom * _backToForegroundListener
void addNewSpriteWithCoords(cocos2d::Vec2 p)
std::vector< cocos2d::Sprite3D * > _sprites
void onTouchesEnded(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
引用了 _backToForegroundListener, _sprites, addNewSpriteWithCoords() , 以及 onTouchesEnded().
◆ ~Sprite3DWithSkinOutlineTest()
| Sprite3DWithSkinOutlineTest::~Sprite3DWithSkinOutlineTest |
( |
| ) |
|
|
virtual |
◆ addNewSpriteWithCoords()
| void Sprite3DWithSkinOutlineTest::addNewSpriteWithCoords |
( |
cocos2d::Vec2 |
p | ) |
|
在文件 Sprite3DTest.cpp 第 1049 行定义.
1052 std::string fileName =
"Sprite3DTest/orc.c3b";
1053 auto sprite = Sprite3D::create(fileName);
1055 auto material = Sprite3DMaterial::createWithFilename(
"Sprite3DTest/outline.material");
1056 material->setTechnique(
"outline_skinned");
1057 sprite->setMaterial(material);
1059 sprite->setScale(3);
1060 sprite->setRotation3D(Vec3(0.0f, 180.0f, 0.0f));
1062 sprite->setPosition(Vec2(p.x, p.y));
1064 auto animation = Animation3D::create(fileName);
1067 auto animate = Animate3D::create(animation);
1068 bool inverse = (std::rand() % 3 == 0);
1070 int rand2 = std::rand();
1074 speed = animate->getSpeed() + CCRANDOM_0_1();
1076 else if (rand2 % 3 == 2)
1078 speed = animate->getSpeed() - 0.5 * CCRANDOM_0_1();
1080 animate->setSpeed(inverse ? -speed : speed);
1082 sprite->runAction(RepeatForever::create(animate));
被这些函数引用 onTouchesEnded() , 以及 Sprite3DWithSkinOutlineTest().
◆ CREATE_FUNC()
◆ onTouchesEnded()
| void Sprite3DWithSkinOutlineTest::onTouchesEnded |
( |
const std::vector< cocos2d::Touch * > & |
touches, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ subtitle()
| std::string Sprite3DWithSkinOutlineTest::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string Sprite3DWithSkinOutlineTest::title |
( |
| ) |
const |
|
overridevirtual |
◆ _backToForegroundListener
| cocos2d::EventListenerCustom* Sprite3DWithSkinOutlineTest::_backToForegroundListener |
|
protected |
◆ _sprites
| std::vector<cocos2d::Sprite3D*> Sprite3DWithSkinOutlineTest::_sprites |
|
protected |
该类的文档由以下文件生成:
- /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