2014-06-11 11:10:07 +08:00
|
|
|
#ifndef __ANIMATION_TEST_SCENE_H__
|
|
|
|
#define __ANIMATION_TEST_SCENE_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
2015-04-03 14:31:03 +08:00
|
|
|
#include "../../BaseTest.h"
|
2014-06-11 11:10:07 +08:00
|
|
|
#include "cocostudio/CocoStudio.h"
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class CocoStudioActionTimelineTests : public TestSuite
|
2014-06-11 11:10:07 +08:00
|
|
|
{
|
2015-04-03 14:31:03 +08:00
|
|
|
public:
|
|
|
|
CocoStudioActionTimelineTests();
|
|
|
|
~CocoStudioActionTimelineTests();
|
2014-06-11 11:10:07 +08:00
|
|
|
};
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class ActionTimelineBaseTest : public TestCase
|
2014-06-11 11:10:07 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title() const;
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
virtual bool init() override;
|
2014-06-11 11:10:07 +08:00
|
|
|
|
|
|
|
// overrides
|
|
|
|
virtual void onExit() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TestActionTimeline : public ActionTimelineBaseTest
|
2014-06-11 11:10:07 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TestActionTimeline);
|
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onEnter() override;
|
2014-06-11 11:10:07 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TestChangePlaySection : public ActionTimelineBaseTest
|
2014-06-17 15:57:30 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TestChangePlaySection);
|
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onEnter() override;
|
2014-06-17 15:57:30 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
void onTouchesEnded(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event* event);
|
2014-06-17 15:57:30 +08:00
|
|
|
|
|
|
|
protected:
|
2015-04-09 12:40:39 +08:00
|
|
|
cocostudio::timeline::ActionTimeline* action;
|
2014-06-17 15:57:30 +08:00
|
|
|
};
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TestTimelineFrameEvent : public ActionTimelineBaseTest
|
2014-06-18 11:22:38 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TestTimelineFrameEvent);
|
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onEnter() override;
|
2014-06-18 11:22:38 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
2015-04-09 12:40:39 +08:00
|
|
|
void onFrameEvent(cocostudio::timeline::Frame* frame);
|
2014-06-18 11:22:38 +08:00
|
|
|
};
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TestTimelinePerformance : public ActionTimelineBaseTest
|
2014-06-17 11:13:46 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TestTimelinePerformance);
|
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onEnter() override;
|
2014-06-17 11:13:46 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TestTimelineAnimationList : public ActionTimelineBaseTest
|
2015-01-28 02:12:09 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TestTimelineAnimationList);
|
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onEnter() override;
|
2015-01-28 02:12:09 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TestTimelineProjectNode : public ActionTimelineBaseTest
|
2015-01-28 02:12:09 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TestTimelineProjectNode);
|
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onEnter() override;
|
2015-01-28 02:12:09 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TestProjectNodeForSimulator : public ActionTimelineBaseTest
|
2015-01-28 02:12:09 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TestProjectNodeForSimulator);
|
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onEnter() override;
|
2015-01-28 02:12:09 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TestTimelineNodeLoadedCallback : public ActionTimelineBaseTest
|
2015-03-12 17:36:39 +08:00
|
|
|
{
|
|
|
|
public:
|
2015-04-03 14:31:03 +08:00
|
|
|
CREATE_FUNC(TestTimelineNodeLoadedCallback);
|
|
|
|
|
2015-03-15 02:33:15 +08:00
|
|
|
virtual void onEnter() override;
|
2015-03-12 17:36:39 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
|
|
|
|
void nodeLoadedCallback(cocos2d::Ref* sender);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2015-04-10 14:52:54 +08:00
|
|
|
class TestActionTimelineEase : public ActionTimelineBaseTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestActionTimelineEase);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2015-07-23 11:51:49 +08:00
|
|
|
class TestActionTimelineSkeleton : public ActionTimelineBaseTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TestActionTimelineSkeleton);
|
|
|
|
|
|
|
|
virtual void onEnter() override;
|
|
|
|
|
|
|
|
virtual std::string title() const override;
|
2015-07-28 19:18:58 +08:00
|
|
|
|
2015-07-23 11:51:49 +08:00
|
|
|
private:
|
2015-07-28 19:18:58 +08:00
|
|
|
void setAllSubBonesDebugDraw(cocostudio::timeline::SkeletonNode* rootSkeleton, bool isShow);
|
|
|
|
|
2015-07-23 11:51:49 +08:00
|
|
|
bool _changedDisplay;
|
|
|
|
bool _changedDisplays;
|
2015-07-28 19:18:58 +08:00
|
|
|
bool _isAllBonesDraw;
|
2015-07-23 11:51:49 +08:00
|
|
|
};
|
2015-07-24 11:38:09 +08:00
|
|
|
|
2015-07-23 16:30:23 +08:00
|
|
|
class TestTimelineExtensionData : public ActionTimelineBaseTest
|
|
|
|
{
|
|
|
|
public:
|
2015-07-23 17:04:08 +08:00
|
|
|
CREATE_FUNC(TestTimelineExtensionData);
|
2015-07-23 16:30:23 +08:00
|
|
|
virtual void onEnter() override;
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2014-06-20 11:36:48 +08:00
|
|
|
#endif // __ANIMATION_SCENE_H__
|