2014-01-14 06:48:12 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2012 cocos2d-x.org
|
|
|
|
Copyright (c) 2013-2014 Chukong Technologies Inc.
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
#ifndef _ActionsTest_H_
|
|
|
|
#define _ActionsTest_H_
|
|
|
|
|
|
|
|
#include "../testBasic.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(ActionsTests);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class ActionsDemo : public TestCase
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
protected:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* _grossini;
|
|
|
|
cocos2d::Sprite* _tamara;
|
|
|
|
cocos2d::Sprite* _kathia;
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
void centerSprites(unsigned int numberOfSprites);
|
|
|
|
void alignSpritesLeft(unsigned int numberOfSprites);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionManual : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionManual);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionMove : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionMove);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2014-12-22 14:34:35 +08:00
|
|
|
class ActionMove3D : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(ActionMove3D);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class ActionScale : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionScale);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionSkew : public ActionsDemo
|
|
|
|
{
|
2012-11-19 17:15:16 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionSkew);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-11-19 17:15:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRotationalSkew : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionRotationalSkew);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-11-19 17:15:16 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRotationalSkewVSStandardSkew : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionRotationalSkewVSStandardSkew);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionSkewRotateScale : public ActionsDemo
|
|
|
|
{
|
2012-11-19 17:15:16 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionSkewRotateScale);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRotate : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionRotate);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRotateBy3D : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(ActionRotateBy3D);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionJump : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionJump);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionBezier : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionBezier);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
class ActionBlink : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionBlink);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
class ActionFade : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionFade);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionTint : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionTint);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
class ActionAnimate : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionAnimate);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2014-05-13 17:08:52 +08:00
|
|
|
|
|
|
|
private:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::EventListenerCustom* _frameDisplayedListener;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
class ActionSequence : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionSequence);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionSequence2 : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionSequence2);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-11 15:54:44 +08:00
|
|
|
|
|
|
|
void callback1();
|
2013-06-20 14:17:10 +08:00
|
|
|
void callback2(Node* sender);
|
2013-06-22 05:58:52 +08:00
|
|
|
void callback3(Node* sender, long data);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
2010-08-09 18:07:50 +08:00
|
|
|
|
|
|
|
class ActionSpawn : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionSpawn);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionReverse : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionReverse);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRepeat : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionRepeat);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionDelayTime : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionDelayTime);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionReverseSequence : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionReverseSequence);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionReverseSequence2 : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionReverseSequence2);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionOrbit : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionOrbit);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2014-04-02 17:12:09 +08:00
|
|
|
virtual void onExit() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
2013-04-01 10:18:26 +08:00
|
|
|
class ActionRemoveSelf : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionRemoveSelf);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2013-04-01 10:18:26 +08:00
|
|
|
};
|
|
|
|
|
2010-08-09 18:07:50 +08:00
|
|
|
class ActionRepeatForever : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionRepeatForever);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void repeatForever(Node* pTarget);
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRotateToRepeat : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionRotateToRepeat);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2010-08-09 18:07:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionRotateJerk : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2010-08-09 18:07:50 +08:00
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionRotateJerk);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2013-06-22 05:58:52 +08:00
|
|
|
class ActionCallFuncN : public ActionsDemo
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionCallFuncN);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-07-26 06:53:24 +08:00
|
|
|
void callback(Node* sender);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionCallFuncND : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionCallFuncND);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-07-26 06:53:24 +08:00
|
|
|
void doRemoveFromParentAndCleanup(Node* sender, bool cleanup);
|
2013-06-22 05:58:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionCallFuncO : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionCallFuncO);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-06-22 05:58:52 +08:00
|
|
|
void callback(Node* object, bool cleanup);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2013-06-04 03:13:24 +08:00
|
|
|
class ActionCallFunction : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionCallFunction);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2013-06-04 03:13:24 +08:00
|
|
|
|
|
|
|
void callback1();
|
2013-06-20 14:17:10 +08:00
|
|
|
void callback2(Node* pTarget);
|
2013-06-22 05:58:52 +08:00
|
|
|
void callback3(Node* pTarget, long data);
|
2013-06-04 03:13:24 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class ActionFollow : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionFollow);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionTargeted : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionTargeted);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2013-08-01 10:28:18 +08:00
|
|
|
class ActionTargetedReverse : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionTargetedReverse);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-08-01 10:28:18 +08:00
|
|
|
};
|
|
|
|
|
2013-02-28 14:42:45 +08:00
|
|
|
class ActionStacked : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionStacked);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
virtual void addNewSpriteWithCoords(cocos2d::Vec2 p);
|
|
|
|
virtual void runActionsInSprite(cocos2d::Sprite* sprite);
|
2015-04-09 14:20:59 +08:00
|
|
|
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
2013-02-28 14:42:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionMoveStacked : public ActionStacked
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionMoveStacked);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
virtual void runActionsInSprite(cocos2d::Sprite* sprite) override;
|
2013-02-28 14:42:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionMoveJumpStacked : public ActionStacked
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionMoveJumpStacked);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
virtual void runActionsInSprite(cocos2d::Sprite* sprite) override;
|
2013-02-28 14:42:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionMoveBezierStacked : public ActionStacked
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionMoveBezierStacked);
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
virtual void runActionsInSprite(cocos2d::Sprite* sprite) override;
|
2013-02-28 14:42:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionCatmullRomStacked : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionCatmullRomStacked);
|
|
|
|
|
2013-02-28 15:32:27 +08:00
|
|
|
virtual ~ActionCatmullRomStacked();
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-02-28 14:42:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionCardinalSplineStacked : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionCardinalSplineStacked);
|
|
|
|
|
2013-02-28 15:32:27 +08:00
|
|
|
virtual ~ActionCardinalSplineStacked();
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-02-28 14:42:45 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class Issue1305 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(Issue1305);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onExit() override;
|
2013-07-26 06:53:24 +08:00
|
|
|
void log(Node* sender);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
private:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* _spriteTmp;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Issue1305_2 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(Issue1305_2);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2012-10-26 04:40:37 +08:00
|
|
|
void printLog1();
|
|
|
|
void printLog2();
|
|
|
|
void printLog3();
|
|
|
|
void printLog4();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Issue1288 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(Issue1288);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Issue1288_2 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(Issue1288_2);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class Issue1327 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(Issue1327);
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
virtual std::string title() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
void logSprRotation(cocos2d::Sprite* sender);
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2012-11-19 17:15:16 +08:00
|
|
|
class Issue1398 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(Issue1398);
|
|
|
|
|
2012-11-19 17:15:16 +08:00
|
|
|
void incrementInteger();
|
2013-06-04 03:13:24 +08:00
|
|
|
void incrementIntegerCallback(void* data);
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
virtual std::string title() const override;
|
2012-11-19 17:15:16 +08:00
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
int _testInteger;
|
2012-11-19 17:15:16 +08:00
|
|
|
};
|
|
|
|
|
2014-05-27 14:40:38 +08:00
|
|
|
class Issue2599 : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(Issue2599);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
private:
|
|
|
|
int _count;
|
|
|
|
};
|
|
|
|
|
2012-06-11 18:25:57 +08:00
|
|
|
class ActionCatmullRom : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionCatmullRom);
|
|
|
|
|
2012-06-11 18:25:57 +08:00
|
|
|
~ActionCatmullRom();
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
virtual std::string title() const override;
|
2012-06-11 18:25:57 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActionCardinalSpline : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(ActionCardinalSpline);
|
|
|
|
|
2012-06-11 18:25:57 +08:00
|
|
|
~ActionCardinalSpline();
|
|
|
|
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
virtual std::string title() const override;
|
2012-06-11 18:25:57 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class PauseResumeActions : public ActionsDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 07:55:36 +08:00
|
|
|
CREATE_FUNC(PauseResumeActions);
|
|
|
|
|
2012-07-24 11:21:08 +08:00
|
|
|
PauseResumeActions();
|
|
|
|
virtual ~PauseResumeActions();
|
2014-02-23 11:16:42 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2014-10-04 00:38:36 +08:00
|
|
|
virtual std::string title() const override;
|
2012-06-11 18:25:57 +08:00
|
|
|
private:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Vector<Node*> _pausedTargets;
|
2012-06-11 18:25:57 +08:00
|
|
|
};
|
|
|
|
|
2015-04-28 17:48:19 +08:00
|
|
|
class ActionFloatTest : public ActionsDemo
|
2015-04-18 20:35:14 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-28 17:48:19 +08:00
|
|
|
CREATE_FUNC(ActionFloatTest);
|
2015-04-18 20:35:14 +08:00
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
#endif
|