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.PasswordField 密码字段
static function PasswordField (password : string, maskChar : char, params options : GUILayoutOption[]) : string
static function PasswordField (password : string, maskChar : char, maxLength : int, params options : GUILayoutOption[]) : string
static function PasswordField (password : string, maskChar : char, style : GUIStyle, params options : GUILayoutOption[]) : string
static function PasswordField (password : string, maskChar : char, maxLength : int, style : GUIStyle, params options : GUILayoutOption[]) : string
Parameters参数
-
passwordPassword to edit. The return value of this function should be assigned back to the string as shown in the example.
可编辑密码,这个函数的返回值应该赋回给这个字符串 -
maskCharCharacter to mask the password with.
用于蒙版密码的字符。 -
maxLengthThe maximum length of the string. If left out, the user can type for ever and ever.
字符串的最大长度,如果不设置,用户将可以永远输入下去。 -
styleThe style to use. If left out, the textField style from the current GUISkin is used.
使用的样式。如果不使用,该文本字段使用当前的GUISkin皮肤 -
optionsAn optional list of layout options that specify extra layouting properties. Any values passed in here will override settings defined by the style.
布局选项指定额外布局属性的一个可选列表。这里传递任意值都将覆盖由style定义的设置。
参考: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight
string - the edited password.
返回字符串类型,可编辑的密码。
Description描述
Make a text field where the user can enter a password.
创建一个单行密码文本字段,用户可以输入密码。
Password field in the Game View.
在游戏视图的中的密码字段。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public string passwordToEdit = "My Password";
void OnGUI() {
passwordToEdit = GUILayout.PasswordField(passwordToEdit, "*"[0], 25);
}
}
var passwordToEdit : String = "My Password";
function OnGUI () {
// Make a password field that modifies passwordToEdit.
//创建一个密码文本字段,用户可以修改密码
passwordToEdit = GUILayout.PasswordField (passwordToEdit, "*"[0], 25);
}
最后修改:2011年6月14日 Tuesday 14:59