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参数

Returns

string - the edited password.

返回字符串类型,可编辑的密码。

Description描述

Make a text field where the user can enter a password.

创建一个单行密码文本字段,用户可以输入密码。

GUILayout.PasswordField 密码字段
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);
}
Page last updated: 2011-6-14