2013-12-26 01:17:04 +08:00
|
|
|
#ifndef __CONS_H__
|
|
|
|
#define __CONS_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "cocostudio/TriggerBase.h"
|
|
|
|
|
|
|
|
|
|
|
|
class TimeElapsed : public cocostudio::BaseTriggerCondition
|
|
|
|
{
|
|
|
|
DECLARE_CLASS_INFO
|
|
|
|
public:
|
|
|
|
TimeElapsed(void);
|
|
|
|
virtual ~TimeElapsed(void);
|
|
|
|
|
|
|
|
virtual bool init();
|
|
|
|
virtual bool detect();
|
|
|
|
virtual void serialize(const rapidjson::Value &val);
|
|
|
|
virtual void removeAll();
|
|
|
|
virtual void update(float dt);
|
|
|
|
private:
|
2014-01-03 01:14:12 +08:00
|
|
|
float _totalTime;
|
|
|
|
float _tmpTime;
|
|
|
|
cocos2d::Scheduler *_scheduler;
|
|
|
|
bool _suc;
|
2013-12-26 01:17:04 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ArmatureActionState : public cocostudio::BaseTriggerCondition
|
|
|
|
{
|
|
|
|
DECLARE_CLASS_INFO
|
|
|
|
public:
|
|
|
|
ArmatureActionState(void);
|
|
|
|
virtual ~ArmatureActionState(void);
|
|
|
|
|
|
|
|
virtual bool init();
|
|
|
|
virtual bool detect();
|
|
|
|
virtual void serialize(const rapidjson::Value &val);
|
|
|
|
virtual void removeAll();
|
|
|
|
void animationEvent(cocostudio::Armature *armature, cocostudio::MovementEventType movementType, const std::string& movementID);
|
|
|
|
private:
|
2014-01-03 01:14:12 +08:00
|
|
|
int _tag;
|
2013-12-26 23:40:50 +08:00
|
|
|
std::string _comName;
|
2013-12-26 01:17:04 +08:00
|
|
|
std::string _aniname;
|
2014-01-03 01:14:12 +08:00
|
|
|
int _state;
|
|
|
|
bool _suc;
|
2013-12-26 01:17:04 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class NodeInRect : public cocostudio::BaseTriggerCondition
|
|
|
|
{
|
|
|
|
DECLARE_CLASS_INFO
|
|
|
|
public:
|
|
|
|
NodeInRect(void);
|
|
|
|
virtual ~NodeInRect(void);
|
|
|
|
|
|
|
|
virtual bool init();
|
|
|
|
virtual bool detect();
|
|
|
|
virtual void serialize(const rapidjson::Value &val);
|
|
|
|
virtual void removeAll();
|
|
|
|
private:
|
2014-01-03 01:14:12 +08:00
|
|
|
int _tag;
|
2013-12-26 01:17:04 +08:00
|
|
|
cocos2d::Point _origin;
|
|
|
|
cocos2d::Size _size;
|
|
|
|
};
|
|
|
|
|
|
|
|
class NodeVisible : public cocostudio::BaseTriggerCondition
|
|
|
|
{
|
|
|
|
DECLARE_CLASS_INFO
|
|
|
|
public:
|
|
|
|
NodeVisible(void);
|
|
|
|
virtual ~NodeVisible(void);
|
|
|
|
|
|
|
|
virtual bool init();
|
|
|
|
virtual bool detect();
|
|
|
|
virtual void serialize(const rapidjson::Value &val);
|
|
|
|
virtual void removeAll();
|
|
|
|
private:
|
2014-01-03 01:14:12 +08:00
|
|
|
int _tag;
|
|
|
|
bool _visible;
|
2013-12-26 01:17:04 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|