#include <TouchesTest.h>
◆ ForceTouchTest()
| ForceTouchTest::ForceTouchTest |
( |
| ) |
|
|
protected |
在文件 TouchesTest.cpp 第 145 行定义.
147 auto s = Director::getInstance()->getWinSize();
149 _infoLabel = Label::createWithTTF(TTFConfig(
"fonts/arial.ttf"),
"Current force value : 0.00, maximum possible force : 0.00");
150 _infoLabel->setPosition(s.width / 2, s.height / 2);
153 auto listener = EventListenerTouchAllAtOnce::create();
157 _eventDispatcher->addEventListenerWithSceneGraphPriority(listener,
this);
void onTouchesMoved(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
cocos2d::Label * _infoLabel
void onTouchesBegan(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
void onTouchesEnded(const std::vector< cocos2d::Touch * > &touches, cocos2d::Event *event)
引用了 _infoLabel, onTouchesBegan(), onTouchesEnded() , 以及 onTouchesMoved().
◆ ~ForceTouchTest()
| ForceTouchTest::~ForceTouchTest |
( |
| ) |
|
|
protectedvirtual |
◆ CREATE_FUNC()
◆ onTouchesBegan()
| void ForceTouchTest::onTouchesBegan |
( |
const std::vector< cocos2d::Touch * > & |
touches, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ onTouchesEnded()
| void ForceTouchTest::onTouchesEnded |
( |
const std::vector< cocos2d::Touch * > & |
touches, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ onTouchesMoved()
| void ForceTouchTest::onTouchesMoved |
( |
const std::vector< cocos2d::Touch * > & |
touches, |
|
|
cocos2d::Event * |
event |
|
) |
| |
◆ subtitle()
| std::string ForceTouchTest::subtitle |
( |
| ) |
const |
|
overridevirtual |
重载 TestCase .
在文件 TouchesTest.cpp 第 169 行定义.
171 return std::string(
"Touch with force to see info label changes\nOnly work on iPhone6s / iPhone6s Plus");
◆ title()
| std::string ForceTouchTest::title |
( |
| ) |
const |
|
overridevirtual |
◆ _infoLabel
| cocos2d::Label* ForceTouchTest::_infoLabel |
|
protected |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/TouchesTest/TouchesTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/TouchesTest/TouchesTest.cpp