BeginArea, EndArea
示例程序 | |
---|---|
说明 | 在 Scene 视图中开启一个指定的绘制区域 |
用法
public static void BeginArea(Rect screenRect);
public static void BeginArea(Rect screenRect, string text);
public static void BeginArea(Rect screenRect, Texture image);
public static void BeginArea(Rect screenRect, GUIContent content);
public static void BeginArea(Rect screenRect, GUIStyle style);
public static void BeginArea(Rect screenRect, string text, GUIStyle style);
public static void BeginArea(Rect screenRect, Texture image, GUIStyle style);
public static void BeginArea(Rect screenRect, GUIContent content, GUIStyle style);
参数
text
区域内要显示的文字。
image
区域内要显示的图片。
content
区域内要显示的文本、图片或者小提示。
style
(可选)该区域的样式。
示例
private void OnSceneGUI () {
Handles.BeginGUI ();
GUILayout.Button ("Button");
GUILayout.BeginArea (new Rect (50, 50, 100, 100), new GUIStyle ("box"));
GUILayout.Button ("Button");
GUILayout.EndArea ();
Handles.EndGUI ();
}