passing parameter to new scene

passing parameter to new scene
0.0 0



I know this question sounds a bit silly, but I would like to know how can I pass the parameters while I’m calling


As the scene method is static, and the init() method is automatically, so I don’t know how to pass integer to the new scene, or to overload the init() method.

I’m appreciate to any help
Thank you


I’m using another init method with params initAfterMainInit(params* param) and init it in my static void scene(params* param).


In your TestScene’s class you can use SCENE_FUNC_PARAM(TestScene, int, yourParam) instead SCENE_NODE_FUNC(TestScene), and don’t forget replace init() method to init(int yourParam);


thank you, Zygis and Alex

I will try it on my project


Aikq have u found solution??
Can you please share sample code. i am stuck