2

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?

4

3 回答 3

1

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.

于 2015-09-25T12:39:20.047 回答
0

在您的画布上,将 Canvas Scaler 组件的 Ui Scale Mode 设置为 Scale with Screen Size。然后您可以定义 1080p 的参考分辨率,即 1920 x 1080。

要查看画布是否适合场景中的相机大小,请将 Canvas 组件的 Render Mode 更改为 Screen Space - Camera,然后将相机从层次结构中拖到它上面。

于 2015-09-25T15:11:18.683 回答
0

这正是您必须使用实际预期的纵横比调试游戏的原因。这必须明确设置,它可以改变你的游戏,因为画布可以彻底改变自己以适应。

在此处输入图像描述

于 2015-09-25T13:33:10.383 回答