In my game I set resolution policy to “kResolutionExactFit”. However, that didn’t worked (I wanted my viewport to stretch over the whole display, while it was maintaining original ratio, leaving borders on the sides).
After a while, I found this line (CCEGLView.cpp, line 451):
CCEGLView::sharedOpenGLView()>setDesignResolutionSize;
No matter which resolution policy I apply you always overwriting it by kResolutionShowAll value.
In my opinion, this is a bug, and you should use existing resolution policy.
Hello ilidan n chenjc,
I am also facing the same problem. I want to use ‘kResolutionNoBorder’ policy but it is not working, instead is always using ‘kResolutionShowAll’ policy as if it is hard coded somewhere.
If you have found any solution plz let me…
Hello Chenjc, i tried the solution you gave but i am facing some weird problem like when i run the project on simulator (x86 architecture) it works fine. But when i test the project in real device (Nokia Lumia 520, on ARM architecture) the solution is not working. Although it is not using ‘kResolutionShowAll’ policy(as previously) but it is using ‘kResolutionExactFit’ policy instead.
I even tried hard coding ‘kResolutionNoBorder’ policy in CCEGLView.cpp(at the same place u told, ie in ‘updateView()’ method) but it is still using the same ‘kResolutionExactFit’ policy.
I need to use ‘kResolutionNoBorder’ policy as my game does not look good in other policies…
Hey Chenjc… i tried every possible thing from… like cleaning n recompiling, creating a new project, hardcoding etc… but i cannot find any solution… I dont know why it is working absolutely FINE in simulator but it is not working in my real device(lumia 520)…
I am using cocos2dx-master version which i downloaded from this link --> https://github.com/cocos2d/cocos2d-x/tree/master/
Hello Chenjc, Did you find any solution of the resolution policy problem… what i have noticed is that in TestCpp samples ‘KResolutionShowAll’ policy is used. In my case every other policy EXCEPT ‘kResolutionNoBorder’ is working fine.
The weird thing is that ‘kResolutionNoBorder’ is working fine on simulators but not on actual device(Lumia 520).
I really need the solution of the problem.
Hi suveerjacob, you said it changed to kResolutionExactFit in all other policy last time, and it was just kResolutionNoBorder not working fine now. But I tests ok. Can you attach some pictures of the errors?
Hey suveerjacob, I couldn’t open the link, send it to my email or attach them in your replyed not using a link, my email jingchen.chen@cocos2d-x.org, Thanks.