Unity-GUI创建控件时控制位置

(1)unity中获取屏幕中间的位置:a = screen.width*0.5f、b = screen.height*0.5f

(2)如Button控件的长宽:w=screen.width*0.2f、h = screen.height*0.2f

(3)Rect(a-w/2, b-h/2, w, h),GUI.Button(new Rect(Screen.width *0.4f, Screen.height*0.4f, Screen.width*0.2f, Screen.height *0.2f), about_Text);

效果如如下:

Unity-GUI创建控件时控制位置_第1张图片


你可能感兴趣的:(GUI,unity,控件)