#include <SpriteTest.h>
◆ Sprite1ETC1Alpha()
| Sprite1ETC1Alpha::Sprite1ETC1Alpha |
( |
| ) |
|
在文件 SpriteTest.cpp 第 215 行定义.
217 auto listener = EventListenerTouchAllAtOnce::create();
219 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener,
this);
void onTouchesEnded(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
引用了 onTouchesEnded().
◆ addNewSpriteWithCoords()
| void Sprite1ETC1Alpha::addNewSpriteWithCoords |
( |
cocos2d::Vec2 |
p | ) |
|
在文件 SpriteTest.cpp 第 236 行定义.
238 auto sprite = Sprite::create(
"Images/grossini_dance_08.png");
239 Texture2D *etcTexture = _director->getTextureCache()->addImage(
"Images/etc1-alpha.pkm");
240 sprite->setTexture(etcTexture);
244 sprite->setPosition(Vec2(p.x, p.y));
246 ActionInterval* action;
247 float random = CCRANDOM_0_1();
250 action = ScaleBy::create(3, 2);
251 else if (random < 0.40)
252 action = RotateBy::create(3, 360);
253 else if (random < 0.60)
254 action = Blink::create(1, 3);
255 else if (random < 0.8)
256 action = TintBy::create(2, 0, -255, -255);
258 action = FadeOut::create(2);
259 auto action_back = action->reverse();
260 auto seq = Sequence::create(action, action_back,
nullptr);
262 sprite->runAction(RepeatForever::create(seq));
cocos2d::Sprite * _background
引用了 _background.
被这些函数引用 init() , 以及 onTouchesEnded().
◆ CREATE_FUNC()
◆ init()
| bool Sprite1ETC1Alpha::init |
( |
| ) |
|
|
override |
◆ onTouchesEnded()
| void Sprite1ETC1Alpha::onTouchesEnded |
( |
const std::vector< cocos2d::Touch * > & |
touches, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ subtitle()
| std::string Sprite1ETC1Alpha::subtitle |
( |
| ) |
const |
|
overridevirtual |
◆ title()
| std::string Sprite1ETC1Alpha::title |
( |
| ) |
const |
|
overridevirtual |
◆ _background
| cocos2d::Sprite* Sprite1ETC1Alpha::_background |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/SpriteTest/SpriteTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/SpriteTest/SpriteTest.cpp