お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
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.
Closetext | グループ上に表示するテキスト |
image | グループ上に表示するTexture |
content | グループのためのテキスト、画像、ツールチップ |
style | 使用する背景画像とパディングの値。省略された場合は、背景は透明になります。 |
options | 特別なレイアウト対応をするためのレイアウトオプションリスト。ここに渡された値は style で定義された設定を上書きします。See Also: GUILayout.Width, GUILayout.Height, GUILayout.MinWidth, GUILayout.MaxWidth, GUILayout.MinHeight, GUILayout.MaxHeight, GUILayout.ExpandWidth, GUILayout.ExpandHeight. |
水平のコントロールグループを開始します
この要素内部にレンダリングされる全てのコントロールは隣同士の水平に配置されていきます。このグループは必ずEndHorizontalで終了させなければいけません。
水平のレイアウト
function OnGUI () { // Starts a horizontal group GUILayout.BeginHorizontal ("box"); GUILayout.Button ("I'm the first button"); GUILayout.Button ("I'm to the right"); GUILayout.EndHorizontal (); }
using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void OnGUI() { GUILayout.BeginHorizontal("box"); GUILayout.Button("I'm the first button"); GUILayout.Button("I'm to the right"); GUILayout.EndHorizontal(); } }
import UnityEngine import System.Collections public class ExampleClass(MonoBehaviour): def OnGUI() as void: GUILayout.BeginHorizontal('box') GUILayout.Button('I\'m the first button') GUILayout.Button('I\'m to the right') GUILayout.EndHorizontal()