#include <MenuTest.h>
◆ RemoveMenuItemWhenMove()
| RemoveMenuItemWhenMove::RemoveMenuItemWhenMove |
( |
| ) |
|
在文件 MenuTest.cpp 第 515 行定义.
517 auto s = Director::getInstance()->getWinSize();
519 auto label = Label::createWithTTF(
"click item and move, should not crash",
"fonts/arial.ttf", 20);
520 label->setPosition(Vec2(s.width/2, s.height - 30));
523 item = MenuItemFont::create(
"item 1");
528 auto menu = Menu::create(
item, back,
nullptr);
530 menu->alignItemsVertically();
532 menu->setPosition(Vec2(s.width/2, s.height/2));
541 _eventDispatcher->addEventListenerWithFixedPriority(
_touchListener, -129);
引用了 _touchListener, goBack(), item, onTouchBegan() , 以及 onTouchMoved().
◆ ~RemoveMenuItemWhenMove()
| RemoveMenuItemWhenMove::~RemoveMenuItemWhenMove |
( |
| ) |
|
◆ goBack()
| void RemoveMenuItemWhenMove::goBack |
( |
cocos2d::Ref * |
pSender | ) |
|
◆ onTouchBegan()
| bool RemoveMenuItemWhenMove::onTouchBegan |
( |
cocos2d::Touch * |
touch, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ onTouchMoved()
| void RemoveMenuItemWhenMove::onTouchMoved |
( |
cocos2d::Touch * |
touch, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ _touchListener
| cocos2d::EventListenerTouchOneByOne* RemoveMenuItemWhenMove::_touchListener |
|
private |
◆ item
| cocos2d::MenuItemFont* RemoveMenuItemWhenMove::item |
|
private |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/MenuTest/MenuTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/MenuTest/MenuTest.cpp