我的游戏分辨率适配是:
Size frameSize = glview->getFrameSize();
float resourceWidth = 1024 ;
float width = frameSize.width;
float heigth = frameSize.height;
float factor = width/heigth;
int designheight= (int)(resourceWidth/factor);
glview->setDesignResolutionSize(1024, designheight, ResolutionPolicy::NO_BORDER);
我所用的Studio版本是1.4.0.1
我的背景图大小为 1024* 1820
我的2dx版本是3.0正式版
现在适配的时候 为什么只裁剪掉上方部分。我后来将UILayer的坐标放到了visibleRect::center().将锚点设成了0.5,0.5 后来发现锚点不叫设置。好坑。
我现在只想裁剪上下两边的背景图。但是现在裁剪的却是上方的部分。
求指教 我该怎么办?
而且我这种适配方式。按钮想设置 visibleRect::top()没法设置。。。。
求指教 我该怎么办?