Search code examples
unity-game-engineunity3d-gui

Unty Canvas not representative of actual layout


I have a canvas on the screen which for some reason is very small compared to my scene. I have a major issue placing UI components in the correct place on the canvas so that they appear in the correct place on the actual game screen.

If you take a look at the 2 attached screen grabs it may make more sense.

first image

second image

the issue I have is that when I run this on my 1080p tv the text does not get positioned correctly at all. if I place it as in the first image then it ends up 8 squares from the top and 15 squares from the right, if I place it as in the second image then it appears 12 squares from the top and 21 from the right.....

I just want the text to be near the top corner.

How do I get the edit screen and actual game to match positioning?


Solution

  • Ok, along with some pointers from Catwood above I worked out the issue. I had not set the canvas to stretch with screen!

    So it was placing the text correctly it was just that the canvas was staying a fixed size rather than filling the screen.