Unable to pass parameters to call back method

Unable to pass parameters to call back method
0.0 0


i am using the following code to do create a sprite from an image

m_pGameLayerSingleton->scheduleOnce(schedule_selector(HelloWorld::callBack), 1.0);

my callback method is declared in this way
void HelloWorld::callBack(jlong imageAddr, float dt) {

How can I pass parameters to this callback method in the above code?


As far as I know you cannot do that. Because schedule_selector is designed to not accept any parameter.


Means I will have to use global variables? is there any other way around this?


I cannot give you the best answer for that. I also want to have schedule_selector to able to accept parameters. You could use global variables, but I suggest you don’t do that. It’s better to change the way you should use the schedule functions.


Ok. Thanks.