Hi,
I was trying to understand AtlasSpriteTest example. And there is a functoin
Class nextAction()
{
sceneIdx++;
sceneIdx = sceneIdx % ( sizeof(transitions) / sizeof(transitions[0]) );
NSString *r = transitions[sceneIdx];
Class c = NSClassFromString(r);
return c;
}
i believe all that do is get the next scene idx then return it as a class. Why you have to create class out of string here? why cant just return an integer?
-(void) nextCallback: (id) sender
{
Scene *s = [Scene node];
[s addChild: [nextAction() node]];
[[Director sharedDirector] replaceScene: s];
}
this is the part i dont get.
so function node belong to scenenode, it creates and returns a scenenode. so how its being called by nextAction? which just return a general class?
THank for reading :)
[edited: using backticks for code]