bool GameScene::init(){ ////////////////////////////// // 1. super init first if (!Layer::init()) { return false; }
Size visibleSize = Director::getInstance()->getVisibleSize(); Vec2 origin = Director::getInstance()->getVisibleOrigin(); auto bg = Sprite::create("tex/bg.jpg"); //bg->setPosition(bg->getContentSize().width,bg->getContentSize().height);//直接设置为屏幕的1/2 bg->setAnchorPoint(Vec2(0, 0));//利用锚点 this->addChild(bg); hero->Hero::create(); hero->setPosition(121,200); this->addChild(hero);
this->schedule(schedule_selector(GameScene::update), 0.01);//每秒刷新100次,可以从fps中看出 //scheduleUpdate();//直接调用update方法 return true;}
无法读取内存,_textureAtlas,_batchnode等等 都无法读取