mirror of https://github.com/axmolengine/axmol.git
35 lines
693 B
C++
35 lines
693 B
C++
#ifndef __DRAGDROPMANAGER_H__
|
|
#define __DRAGDROPMANAGER_H__
|
|
|
|
#include "FairyGUIMacros.h"
|
|
#include "cocos2d.h"
|
|
#include "GLoader.h"
|
|
|
|
NS_FGUI_BEGIN
|
|
|
|
class DragDropManager
|
|
{
|
|
public:
|
|
DragDropManager();
|
|
~DragDropManager();
|
|
|
|
static DragDropManager* getInstance();
|
|
|
|
GLoader* getAgent() const { return _agent; }
|
|
bool isDragging() const { return _agent->getParent() != nullptr; }
|
|
void startDrag(const std::string& icon, const axis::Value& sourceData = axis::Value::Null, int touchPointID = -1);
|
|
void cancel();
|
|
|
|
private:
|
|
void onDragEnd(EventContext* context);
|
|
|
|
static DragDropManager* _inst;
|
|
|
|
GLoader* _agent;
|
|
axis::Value _sourceData;
|
|
};
|
|
|
|
NS_FGUI_END
|
|
|
|
#endif
|