GUILayout.Width 宽度

static function Width (width : float) : GUILayoutOption

Description描述

Option passed to a control to give it an absolute width.

传递给控件的选项,给它一个绝对的宽度。

GUILayout.Width 宽度

Fixed width for a GUI Control.
用于一个GUI控件的固定宽度。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		GUILayout.Button("A Button with fixed width", GUILayout.Width(300));
	}
}
// Draws a button with a fixed width
//绘制一个带有觉得宽度的按钮
function OnGUI() {
	GUILayout.Button("A Button with fixed width", GUILayout.Width(300));
}
Page last updated: 2011-6-14