Box
示例程序 | |
---|---|
说明 | 生成一个自动布局的 box |
用法
public static void Box(Texture image, params GUILayoutOption[] options);
public static void Box(string text, params GUILayoutOption[] options);
public static void Box(GUIContent content, params GUILayoutOption[] options);
public static void Box(Texture image, GUIStyle style, params GUILayoutOption[] options);
public static void Box(string text, GUIStyle style, params GUILayoutOption[] options);
public static void Box(GUIContent content, GUIStyle style, params GUILayoutOption[] options);
参数
text
区域内要显示的文字。
image
区域内要显示的图片。
content
区域内要显示的文本、图片或者小提示。
style
(可选)该区域的样式。
options
(可选)用于指定额外的布局属性,该参数将覆盖默认样式。
示例
private void OnSceneGUI () {
Handles.BeginGUI ();
GUILayout.Box (new GUIContent("This is a box", _target.texture, "This is a box"));
Handles.EndGUI ();
}