gameScoreLabel = CCLabelTTF::create("0", "Arial", 30);
gameScoreLabel->setColor(ccRED);
gameScoreLabel->retain();
gameScoreLabel->setPosition(ccp(s.width / 6, s.height / 6) );
this->addChild(gameScoreLabel, 1);
this->schedule(schedule_selector(MyHelloWorld::scheduleFunction), 0.02);
if(!m_pMusic) {
m_pMusic = new MusicNotificy;
m_pMusic->initMusicNotify();
this->addChild(m_pMusic);
CCDirector::sharedDirector()->setNotificationNode(m_pMusic); //在添加了句代码之后,我们在切换场景之后,我们的这个
m_pMusic node就不会被删掉,一直留在Page里面!
}
cocos2dx之创建悬浮节点
最新推荐文章于 2021-10-12 17:30:29 发布