Hi All,
I’m trying to set up a tiled background and I made a 1920x1080 image to be placed inside a 1920x1080 canvas. However when I look at the image it looks like its way larger than 1920x1080 and can’t fit inside the canvas. I’m not sure where I’ve gone wrong.
- I set the canvas width and height to 1920x1080
- I set the render mode of the canvas to world space (I’ll be having elements setting in the foreground and background)
- I set the UI Image size to 1920 x 1080
I attached some images showing the inspector for both the canvas and the image. Any help would be greatly appreciated!
Thanks in advance!
Shawn
Was doing research into setting the render mode of the canvas to world space. It’s clear I misunderstood. I understand now that when I set the render mode to world space, the canvas now becomes an object in the scene like any other game object. I will have to adjust its size. I’m not super sure how the math will work out, if I could get help on sizing this image to fit snugly on a camera of size 6 with a 16:9 resolution that would be awesome.
Figured out the problem. I was not scaling my canvas appropriately to fit my camera after changing the render mode to world space. The math worked out to being:
1 Tile = 160 px by 160px
Canvas Width = 1920 px
of Tiles that fit in screen width = 1920/160 = 12 tiles, and we want 1 tile = 1 world unit
So 12 world units fit in our width, so I need to scale the canvas image down by a factor of 12/1920 = 0.00625
Hope this helps someone else!
Cheers,
Shawn
1 Like