2012-04-19 14:35:52 +08:00
|
|
|
#ifndef __PERFORMANCE_TOUCHES_TEST_H__
|
|
|
|
#define __PERFORMANCE_TOUCHES_TEST_H__
|
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
#include "BaseTest.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
DEFINE_TEST_SUITE(PerformceTouchesTests);
|
|
|
|
|
|
|
|
class TouchesMainScene : public TestCase
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual void update(float dt) override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
protected:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Label* _plabel;
|
2013-12-19 05:52:10 +08:00
|
|
|
int numberOfTouchesB;
|
|
|
|
int numberOfTouchesM;
|
|
|
|
int numberOfTouchesE;
|
|
|
|
int numberOfTouchesC;
|
|
|
|
float elapsedTime;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2011-03-25 13:59:08 +08:00
|
|
|
class TouchesPerformTest1 : public TouchesMainScene
|
|
|
|
{
|
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(TouchesPerformTest1);
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* event);
|
|
|
|
void onTouchMoved(cocos2d::Touch* touch, cocos2d::Event* event);
|
|
|
|
void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* event);
|
|
|
|
void onTouchCancelled(cocos2d::Touch* touch, cocos2d::Event* event);
|
2011-03-25 13:59:08 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class TouchesPerformTest2 : public TouchesMainScene
|
|
|
|
{
|
2011-03-25 13:59:08 +08:00
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(TouchesPerformTest2);
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
void onTouchesBegan(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
|
|
|
void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
|
|
|
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
|
|
|
void onTouchesCancelled(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
2013-09-15 17:49:36 +08:00
|
|
|
};
|
|
|
|
|
2015-05-11 16:26:14 +08:00
|
|
|
class TouchesPerformTest3 : public TestCase
|
2013-09-15 17:49:36 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-05-11 16:26:14 +08:00
|
|
|
CREATE_FUNC(TouchesPerformTest3);
|
|
|
|
|
2013-09-15 17:49:36 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|