// // Redream的QCoreBtn加载类 // #ifndef RUQCoreBtn_h #define RUQCoreBtn_h #include "RUQCoreLayer.h" #include "RUDefine.h" NS_RU_BEGIN class QCoreBtn:public QCoreLayer { public: static QCoreBtn * Layer(string file); RED_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(QCoreBtn, create); QCoreBtn(); ~QCoreBtn(); virtual cocos2d::extension::Control::Handler onResolveREDCCControlSelector(cocos2d::Ref * pTarget, const char * pSelectorName) override; virtual void onNodeLoaded(cocos2d::Node * node, redream::NodeLoader * nodeLoader) override; virtual void resetParticle(std::string name); virtual void ResetButton(); virtual void setTouchEnable(bool enable); std::function coreClickButton = nullptr; virtual void ingroPlayEffect(); void setTimelines(const char* tl4Tap, const char* tl4Release); protected: virtual void clScheduOnce(float dt); //----------ccb中所有的按钮都用一个函数 onBtnMenu 然后用tag 来区分是那个按钮 virtual void OnClickCCBButton(cocos2d::Ref * sender, cocos2d::extension::Control::EventType pControlEvent); virtual void clickBtnSechel(float t); //------延时调用的函数 protected: int _mClickButtonTag; //------需要把点击按钮的tag保存在这个变量里面 bool _bCanClickButton; //------用来保证状态的变量 //------------ bool _playEffect; Vec2 _lastWorldPos; bool _isPlayRelease; std::string _tapTL; std::string _releaseTL; }; class QCoreBtnLoader : public redream::LayerLoader { public: RED_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(QCoreBtnLoader, loader); protected: RED_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(QCoreBtn); }; NS_RU_END #endif /* defined(RUQCoreBtn_h) */