2020-08-04 12:31:33 +08:00
|
|
|
#ifndef __FAIRYGUIMACROS_H__
|
|
|
|
#define __FAIRYGUIMACROS_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
|
|
|
#define NS_FGUI_BEGIN namespace fairygui {
|
|
|
|
#define NS_FGUI_END }
|
|
|
|
#define USING_NS_FGUI using namespace fairygui
|
|
|
|
|
|
|
|
#define CALL_LATER_FUNC(__TYPE__,__FUNC__) \
|
|
|
|
void __selector_##__FUNC__(float dt) \
|
|
|
|
{\
|
2022-07-15 19:17:01 +08:00
|
|
|
axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this);\
|
2020-08-04 12:31:33 +08:00
|
|
|
__FUNC__(); \
|
|
|
|
}\
|
|
|
|
void __FUNC__()
|
|
|
|
|
|
|
|
#define CALL_LATER(__TYPE__,__FUNC__,...) \
|
2022-07-15 19:17:01 +08:00
|
|
|
if (!axis::Director::getInstance()->getScheduler()->isScheduled(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this))\
|
|
|
|
axis::Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this, (__VA_ARGS__+0), false)
|
2020-08-04 12:31:33 +08:00
|
|
|
|
|
|
|
#define CALL_LATER_CANCEL(__TYPE__,__FUNC__) \
|
2022-07-15 19:17:01 +08:00
|
|
|
axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this)
|
2020-08-04 12:31:33 +08:00
|
|
|
|
|
|
|
#define CALL_PER_FRAME(__TYPE__,__FUNC__) \
|
2022-07-15 19:17:01 +08:00
|
|
|
if (!axis::Director::getInstance()->getScheduler()->isScheduled(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this))\
|
|
|
|
axis::Director::getInstance()->getScheduler()->schedule(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this, 0, false)
|
2020-08-04 12:31:33 +08:00
|
|
|
|
|
|
|
#define CALL_PER_FRAME_CANCEL(__TYPE__,__FUNC__) \
|
2022-07-15 19:17:01 +08:00
|
|
|
axis::Director::getInstance()->getScheduler()->unschedule(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this)
|
2020-08-04 12:31:33 +08:00
|
|
|
|
|
|
|
#define UIRoot GRoot::getInstance()
|
|
|
|
|
|
|
|
#include "FieldTypes.h"
|
|
|
|
|
|
|
|
#endif
|