Why does ResolutionPolicy::SHOW_ALL move the layer up ? #2510
Unanswered
rahuliyers
asked this question in
Q&A
Replies: 1 comment 3 replies
-
I edited your post just to fix the formatting, since it wasn't rendering the bottom image and text properly. Are you able to upload a minimal test project with the exact code you're using to show the examples from your post? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
With FIXED_WIDTH policy:


With SHOW_ALL policy:
Code:
The simulator is iPhone 15. The design resolution size is 2048 x 1536. Orientation is Portrait.
There are a couple of things I don't understand:
auto pos = Vec2(visibleSize.width / 2 + origin.x,size.height/2 + origin.y);
Then the simulator looks like this:
So it seems strange to me the way the scene is rendered on screen in SHOW_ALL. I understand how the resolution policy used to work in cocos2d-x because I published multiple apps to iOS and android. But here it seems weird. I understand that sometimes one can have bars above and below depending on the aspect ration. But in this case, the entire scene seems to have been moved up, and the top of the scene is cut off.
Can someone please explain to me so I understand if I am doing something wrong ? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions