GUILayoutOption

作者:追风剑情 发布于:2015-11-26 17:52 分类:GUI

内部类用于传递布局选项给GUILayout函数。你不要直接使用这些,而是在GUILayout类布局函数中构造它们。

参见:GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.


示例:

using UnityEngine;
using System.Collections;

public class GUITest : MonoBehaviour {

	void OnGUI () {

        if (GUILayout.Button("This is a button", GUILayout.Width(100f), GUILayout.Height(50f)))
        {

        }
	}
}

标签: GUI

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号