Cocos2d-x中定时器的使用
CCTimer:轻量级的计时器
- CCTimer (void)
- ccTime getInterval (void)
- void setInterval (ccTime fInterval)
- bool initWithTarget (CCObject *pTarget, SEL_SCHEDULE pfnSelector)
- bool initWithTarget (CCObject *pTarget, SEL_SCHEDULE pfnSelector, ccTime fSeconds)
- bool initWithScriptFuncName (const char *pszFuncName, ccTime fSeconds)
- void update (ccTime dt)
- static CCTimer * timerWithTarget (CCObject *pTarget, SEL_SCHEDULE pfnSelector)
- static CCTimer * timerWithScriptFuncName (const char *pszFuncName, ccTime fSeconds)
- static CCTimer * timerWithTarget (CCObject *pTarget, SEL_SCHEDULE pfnSelector, ccTime fSeconds)
- SEL_SCHEDULE m_pfnSelector
- ccTime m_fInterval
- std::string m_scriptFunc
- CCObject * m_pTarget
- ccTime m_fElapsed
this->schedule(schedule_selector(MCoinsGameScene::myTimer),1); 每隔一秒执行myTimer方法