tothex
June 15, 2017, 10:10pm
#1
Hello i am transitioning between 2 scenes and i use the code i found here :
I can’t for the life of me work out why, but as soon as I “replaceScene”, schedule functions seem to mysteriously not work in the scene I’ve just switched to!
I’ve read that placing them into the onEnter function solves the problem, but unfortunately it doesn’t for me. I’ve tried just about everything I can think of but I can’t get it working.
I’ve also read that people have experienced similar problems when their classes extended CCScene, my class is extending CCLayerColor.
I’ve also tried a…
so my update function is properly called after the transition
my code is
void HelloWorld::onEnter()
{
CCNode::onEnter();
this->scheduleUpdate();
}
My question is how can we call CCNode::onEnter() without creating an object of type CCNode first
shouldn’t CCNode::onEnter be a static function
what feature of c++ is beeeing used here?
Thanks!!!
For me it looks that HelloWorld is a derivered class from CCNode, thus it’s first calling it’s Base class.
1 Like
tothex
June 16, 2017, 2:22pm
#3
i got it
class HelloWorld : public cocos2d::Layer
it inherits from Layer wich inherits from Node