Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

EditorGUILayout.RectField

フィードバック

ありがとうございます

この度はドキュメントの品質向上のためにご意見・ご要望をお寄せいただき、誠にありがとうございます。頂いた内容をドキュメントチームで確認し、必要に応じて修正を致します。

閉じる

送信に失敗しました

なんらかのエラーが発生したため送信が出来ませんでした。しばらく経ってから<a>もう一度送信</a>してください。ドキュメントの品質向上のために時間を割いて頂き誠にありがとうございます。

閉じる

キャンセル

マニュアルに切り替える
public static function RectField(value: Rect, params options: GUILayoutOption[]): Rect;
public static Rect RectField(Rect value, params GUILayoutOption[] options);
public static function RectField(label: string, value: Rect, params options: GUILayoutOption[]): Rect;
public static Rect RectField(string label, Rect value, params GUILayoutOption[] options);
public static function RectField(label: GUIContent, value: Rect, params options: GUILayoutOption[]): Rect;
public static Rect RectField(GUIContent label, Rect value, params GUILayoutOption[] options);

パラメーター

label フィールドの上に表示するラベル
value 編集する値
options 特別なレイアウト対応をするためのレイアウトオプションリスト。ここに渡された値は style で定義された設定を上書きします。
See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight.

戻り値

Rect ユーザーによって設定された値

説明

Rect を入力する X、Y、W と H のフィールドを作成します。


“別の Window の位置とサイズの値を変更します。”

	// Simple Script that lets you modify another's window position value
	//
	// To use this script you need to open first the DummyWindow window.
	
	class MoveResizeSelectedWindow extends EditorWindow {
	
		var pos : Rect;
	
		@MenuItem("Examples/Move - Resize other window")
		static function Init() {
			var window = GetWindow(MoveResizeSelectedWindow);
			window.Show();
		}
		
		function OnGUI() {
			DummyWindow.instance.position = 
				EditorGUILayout.RectField("Window's position:", 
											DummyWindow.instance.position);
			if(GUILayout.Button("Reset position"))
				DummyWindow.instance.position = Rect(0,0,200,200);	
			if(GUILayout.Button("Close"))
				this.Close();
		}
	}

例で動作しているスクリプト。

	// Dummy window that is going to be moved.
	
	class DummyWindow extends EditorWindow {
	
		static var instance;
		@MenuItem("Examples/Dummy Window")
		static function Init() {
			var window = GetWindow(DummyWindow);
			window.Show();
		}
		function DummyWindow() {
			instance = this;
		}
	}