GUILayout
- BeginArea
- BeginHorizontal
- BeginScrollView
- BeginVertical
- Box
- Button
- EndArea
- EndHorizontal
- EndScrollView
- EndVertical
- ExpandHeight
- ExpandWidth
- FlexibleSpace
- Height
- HorizontalScrollbar
- HorizontalSlider
- Label
- MaxHeight
- MaxWidth
- MinHeight
- MinWidth
- PasswordField
- RepeatButton
- SelectionGrid
- Space
- TextArea
- TextField
- Toggle
- Toolbar
- VerticalScrollbar
- VerticalSlider
- Width
- Window
GUILayout.Width 宽度
static function Width (width : float) : GUILayoutOption
Description描述
Option passed to a control to give it an absolute width.
传递给控件的选项,给它一个绝对的宽度。
Fixed width for a GUI Control.
用于一个GUI控件的固定宽度。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
GUILayout.Button("A Button with fixed width", GUILayout.Width(300));
}
}
// Draws a button with a fixed width
//绘制一个带有觉得宽度的按钮
function OnGUI() {
GUILayout.Button("A Button with fixed width", GUILayout.Width(300));
}
最后修改:2011年6月14日 Tuesday 14:31