SpriteFrameCache::getInstance()->addSpriteFramesWithFile("shoot_background.plist");
//加载背景图片1
background1 = Sprite::createWithSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("background.png"));
background1->setAnchorPoint(Point::ZERO);
background1->setPosition(Point(0, 0));
background1->getTexture()->setAliasTexParameters();
this->addChild(background1);
//加载背景图片2
background2 = Sprite::createWithSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("background.png"));
background2->setAnchorPoint(Point::ZERO);
background2->setPosition(Point(0,background2->getContentSize().height-2));
background1->getTexture()->setAliasTexParameters();
this->addChild(background2);
```
3.0正式版
图1:
代码和图片都用的版主偶尔e往事 提供的飞机大战工程里面的,为什么我的背景图片只显示一部分呢?
图2:
是版主的项目运行后的
求教
自己去看这个AppDlegate类。setdesignresolutionsize
哇咔咔咔咔!多谢楼上指点啊 ,我新建的项目
少了glview->setDesignResolutionSize(480, 800, ResolutionPolicy::EXACT_FIT);
这个适配策略
终于找到原因了,多谢多谢