I have a canvas with “Fit Width” and “Fit Height” enabled, so that the content always fits on the screen entirely. Now I want to add an image which is stretched to the actual resolution of the screen, but a Widget component won’t do the trick as the Canvas’ size doesn’t span the full screen:
If I add an additional canvas without “Fit Width” and “Fit Height” and add the background image as a sprite, the camera zooms in for both canvases, which I don’t want:
Just write custom script which applies scale. But… I see you game probably will use physics engine. Not proportional scaling will not work correctly with physics engine… You definitely should think about other approach like applying decorative elements on side, use only portrait orientation or move camera around whole game board.
Yep, but it’s ease to solve this problem. I never use both “fitWidth” and “fitHeight” instead of that I use only of them and if game require minimum virtual screen size to keep both dimensions I switch this options from code, next I set constant size for selected node to fit wanted dimensions and I still can use widgets to cover whole screen with background or other decorations.
If real screen width is bigger than height I use fitHeight in other case I use fitWidth and it has similar side effect but still canvas covers whole screen.