axmol/extensions/fairygui/FairyGUIMacros.h

36 lines
1.4 KiB
C
Raw Normal View History

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-08-08 18:02:17 +08:00
ax::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-08-08 18:02:17 +08:00
if (!ax::Director::getInstance()->getScheduler()->isScheduled(AX_SCHEDULE_SELECTOR(__TYPE__::__selector_##__FUNC__), this))\
ax::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-08-08 18:02:17 +08:00
ax::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-08-08 18:02:17 +08:00
if (!ax::Director::getInstance()->getScheduler()->isScheduled(AX_SCHEDULE_SELECTOR(__TYPE__::__FUNC__), this))\
ax::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-08-08 18:02:17 +08:00
ax::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