我有一个2D游戏设置为1080p像素大小(所以每个单位等于1像素),我已经添加了一个画布到我的场景。 然而,画布仅填充屏幕的大约1/8,也不是中心。 所有画布大小和位置设置都被锁定,因此我无法移动它或调整其大小。 画布本身确实反映了屏幕(即如果我将文本放在右上角它正确显示),但是尺寸使得很难判断最佳位置元素的位置)。
如何让画布填满我的场景?
I have a 2D game set to 1080p pixel size (so each unit equals 1 pixel) and I have added a canvas to my scene. However the canvas fills only about 1/8th of the screen and is also not central either. All the canvas size and position settings are locked so I cant move it or resize it. The canvas itself does reflect the screen (ie if I put text in the top right corner it appears correctly) but the size makes it hard to judge where best to position the elements).
How do I get the canvas to fill my scene?
最满意答案
在画布上,将Canvas Scaler组件的Ui Scale Mode为Scale with Screen Size 。 然后,您可以定义1080p的Reference Resolution ,即1920 x 1080。
编辑:要查看画布是否适合场景中相机的大小,请将“ Canvas组件的“ Render Mode更改为“ Screen Space - Camera ,然后将相机从层次结构拖到其中。
On your canvas, set the Canvas Scaler component's Ui Scale Mode to Scale with Screen Size. Then you can define a Reference Resolution of 1080p, i.e. 1920 x 1080.
EDIT: To see the canvas fit into the camera's size in the scene, change the Canvas component's Render Mode to Screen Space - Camera, and drag the camera from the hierarchy to it.
更多推荐
画布,size,canvas,位置,电脑培训,计算机培训,IT培训"/> <meta name="description
发布评论