#include <Sprite3DTest.h>
◆ Sprite3DEffectTest()
| Sprite3DEffectTest::Sprite3DEffectTest |
( |
| ) |
|
在文件 Sprite3DTest.cpp 第 755 行定义.
757 auto s = Director::getInstance()->getWinSize();
760 auto listener = EventListenerTouchAllAtOnce::create();
762 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener,
this);
763#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
767 auto material = Sprite3DMaterial::createWithFilename(
"Sprite3DTest/outline.material");
768 material->setTechnique(
"outline_noneskinned");
771 sprite->setMaterial(material->clone());
cocos2d::EventListenerCustom * _backToForegroundListener
void addNewSpriteWithCoords(cocos2d::Vec2 p)
void onTouchesEnded(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
std::vector< cocos2d::Sprite3D * > _sprites
引用了 _backToForegroundListener, _sprites, addNewSpriteWithCoords() , 以及 onTouchesEnded().
◆ ~Sprite3DEffectTest()
| Sprite3DEffectTest::~Sprite3DEffectTest |
( |
| ) |
|
|
virtual |
◆ addNewSpriteWithCoords()
| void Sprite3DEffectTest::addNewSpriteWithCoords |
( |
cocos2d::Vec2 |
p | ) |
|
在文件 Sprite3DTest.cpp 第 795 行定义.
798 auto sprite = Sprite3D::create(
"Sprite3DTest/boss1.obj");
799 auto material = Sprite3DMaterial::createWithFilename(
"Sprite3DTest/outline.material");
800 material->setTechnique(
"outline_noneskinned");
801 sprite->setMaterial(material);
802 sprite->setScale(6.f);
803 Director::getInstance()->getTextureCache()->removeUnusedTextures();
808 sprite->setPosition(Vec2(p.x, p.y));
810 ActionInterval* action;
811 float random = CCRANDOM_0_1();
814 action = ScaleBy::create(3, 2);
815 else if (random < 0.40)
816 action = RotateBy::create(3, 360);
817 else if (random < 0.60)
818 action = Blink::create(1, 3);
819 else if (random < 0.8)
820 action = TintBy::create(2, 0, -255, -255);
822 action = FadeOut::create(2);
823 auto action_back = action->reverse();
824 auto seq = Sequence::create(action, action_back,
nullptr);
826 sprite->runAction(RepeatForever::create(seq));
引用了 _sprites.
被这些函数引用 onTouchesEnded() , 以及 Sprite3DEffectTest().
◆ CREATE_FUNC()
◆ onTouchesEnded()
| void Sprite3DEffectTest::onTouchesEnded |
( |
const std::vector< cocos2d::Touch * > & |
touches, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ subtitle()
| std::string Sprite3DEffectTest::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string Sprite3DEffectTest::title |
( |
| ) |
const |
|
overridevirtual |
◆ _backToForegroundListener
| cocos2d::EventListenerCustom* Sprite3DEffectTest::_backToForegroundListener |
|
protected |
◆ _sprites
| std::vector<cocos2d::Sprite3D*> Sprite3DEffectTest::_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