EditorGUILayout.LabelField 标签字段


static function LabelField (label : string, label2 : string, params options : GUILayoutOption[]) : void

Parameters参数

  • label
    Label in front of the label field. // 在标签字段前面的标签
  • label2
    The label to show to the right. // 显示在右侧的标签
  • options
    An optional list of layout options that specify extra layouting   properties. Any values passed in here will override settings defined by   the style.  See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
       指定额外布局属性的可选列表。这里传递任意值,将覆盖样式定义的设置。

Description描述

Make a label field. (Useful for showing read-only info.)

制作一个标签字段。(通常用于显示只读信息)

EditorGUILayout.LabelField 标签字段

Shows a label in the editor (Label) with the seconds since the editor started (Label2).

在编辑器显示一个标签,带有自编辑器开始秒数。

// Shows a label in the editor with the seconds since the editor started//在编辑器显示一个标签,带有自编辑器开始的秒数class EditorGUILayoutLabel extends EditorWindow {@MenuItem("Examples/Editor GUILayout Label Usage")static function Init() {var window = GetWindow(EditorGUILayoutLabel);window.Show();}function OnGUI() {EditorGUILayout.LabelField("Time since start: ",EditorApplication.timeSinceStartup.ToString());this.Repaint();}}


,