Closed nk-5 closed 3 years ago
@minggo I would appreciate it if you could confirm this pr.
How to change the size? From portrait to landscape?
How to change the size? From portrait to landscape?
@minggo The size of the layer changes when the screen is rotated, assuming that the application has been implemented to support portrait and landscape. Specifically, we call the setFrameSize and setDesignResolutionSize api of GLView to change the size when the screen is rotated.
Got it, thanks.
in forum discuss
https://discuss.cocos2d-x.org/t/in-cocos2dx-v4-0-the-screen-becomes-half-size-when-you-change-the-device-from-portrait-to-landscape/51631
background
Cause of the problem
It turns out that the cause of the problem is that the layer of CCEAGLView is CAMetalLayer, and CAMetalLayer.drawableSize is not updated when CCEAGLView.layoutSubView is used.
Revision details
Fixed to resize CAMetalLayer on CCEAGLView layoutSubviews.
related issues
20618