言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

GUILayout.FlexibleSpace

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function FlexibleSpace(): void;
public static void FlexibleSpace();
public static def FlexibleSpace() as void

Description

フレキシブルなスペースを挿入します

フレキシブルなスペースはレイアウトの残ったスペースを使用します。 注意: これは GUILayout.ExpandWidthGUILayout.ExpandHeight によってオーバーライドされます。
GUILayoutエリアにあるフレキシブルなスペース

	var sliderValue : float = 1.0;

	function OnGUI() {
		// Wrap everything in the designated GUI Area
		GUILayout.BeginArea (Rect (0,0,200,60));
		// Begin the singular Horizontal Group
		GUILayout.BeginHorizontal();
		// Place a Button normally
		GUILayout.RepeatButton ("A button with\ntwo lines");
		// Place a space between the button and the vertical area
		// so it fits the whole area
		GUILayout.FlexibleSpace();
		// Arrange two more Controls vertically beside the Button
		GUILayout.BeginVertical();	
		GUILayout.Box("Value:" + Mathf.Round(sliderValue));
		sliderValue = GUILayout.HorizontalSlider (sliderValue, 0.0, 10);

		// End the Groups and Area
		GUILayout.EndVertical();
		GUILayout.EndHorizontal();
		GUILayout.EndArea();
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public float sliderValue = 1.0F;
    void OnGUI() {
        GUILayout.BeginArea(new Rect(0, 0, 200, 60));
        GUILayout.BeginHorizontal();
        GUILayout.RepeatButton("A button with\ntwo lines");
        GUILayout.FlexibleSpace();
        GUILayout.BeginVertical();
        GUILayout.Box("Value:" + Mathf.Round(sliderValue));
        sliderValue = GUILayout.HorizontalSlider(sliderValue, 0.0F, 10);
        GUILayout.EndVertical();
        GUILayout.EndHorizontal();
        GUILayout.EndArea();
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public sliderValue as float = 1.0F

	def OnGUI() as void:
		GUILayout.BeginArea(Rect(0, 0, 200, 60))
		GUILayout.BeginHorizontal()
		GUILayout.RepeatButton('A button with\ntwo lines')
		GUILayout.FlexibleSpace()
		GUILayout.BeginVertical()
		GUILayout.Box(('Value:' + Mathf.Round(sliderValue)))
		sliderValue = GUILayout.HorizontalSlider(sliderValue, 0.0F, 10)
		GUILayout.EndVertical()
		GUILayout.EndHorizontal()
		GUILayout.EndArea()