schedule selector

schedule selector
0.0 0


i’m getting a weird error on VS while compiling my code (Win32 app with lastest cocos2dx version):

“error C2440: ‘type cast’ : cannot convert from ‘void (__thiscall LevelScene::* )(cocos2d::CCTime)’ to ‘cocos2d::SEL_SCHEDULE’”

i’ve googled, searched in the forum, but nothing seems to be useful.

The fact is that there’s nothing uncorrect in my code syntax, as you can see:

i’m calling the scheduler in this way: this->schedule(schedule_selector(LevelScene::GameLogic), 1);

and my function is: void LevelScene::GameLogic(CCTime ct){}

i really don’t understand where’s the problem.
(I attach my class files to this post )

Thnx for your help! (1.9 KB)



Your error is directly related to the issue I reported earlier - about ccTime and CCTime classes in latest cocos2d-x.

All you have to do is to change your method declaration from void GameLogic(CCTime ct)

into void GameLogic(float ct)

Becasue ccTime has been removed and SEL_SCHEDULE is declared as void (CCObject::*)(float)

Hope it helped :smiley:



yes it is!
thank you :slight_smile: