Two templates For Horisontal and Vertical

Hi fellows !
I’ve been struggling with the task for a month now, and have already tried almost everything. I really count on your help.
I’m trying to make two separate display templates for horizontal orientation and for vertical orientation. There are no problems with the horizontal one, but with the vertical one I have big problems.
There is a template and it is the same size as the horizontal one (1864x860), but inverted 860x1864.
I have a script that determines whether the width or height is greater and disables and enables templates accordingly. But the horizontal template, for some reason, does not want to take its place and is displayed in the middle, but without stretching in height.
I’m trying to achieve the desired result by essentially making the layout of the elements as in a horizontal template, but when executing the script, rotating it by 90 degrees. I tried to rotate both the canvas and the camera and the root element with all the elements inside. I can’t achieve the desired result :frowning:
Attached is a photo hierarchy, a good display of the horizontal template and what I get on the vertical one.
I ask for help, friends!
3


Hi, friend.

The orientation of your game is determined when the engine starts.

If you want to change it, just modifying the size of the Canvas is not enough.

You can read the start code of the engine to see how to change it.

By the way, you need to handle this separately on the web, android, and iOS. because they are different on this point.

Thank you for your reply.
I just want to do it on web, without IOS or Android.
As i understood you message - i need to make changes by TS code in scripts, and there is no functions tools in Cocos with which i can do it without coding?

I‘m afraid not.
You need to modify code by yourself.