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.


示例:

  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class GUITest : MonoBehaviour {
  5.  
  6. void OnGUI () {
  7.  
  8. if (GUILayout.Button("This is a button", GUILayout.Width(100f), GUILayout.Height(50f)))
  9. {
  10.  
  11. }
  12. }
  13. }

标签: GUI

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号