GUILayout.Boxstatic function Box (image : Texture, params options : GUILayoutOption[]) : voidstatic function Box (text : String, params options : GUILayoutOption[]) : voidstatic function Box (content : GUIContent, params options : GUILayoutOption[]) : voidstatic function Box (image : Texture, style : GUIStyle, params options : GUILayoutOption[]) : voidstatic function Box (text : String, style : GUIStyle, params options : GUILayoutOption[]) : voidstatic function Box (content : GUIContent, style : GUIStyle, params options : GUILayoutOption[]) : voidParameters
DescriptionMake an auto-layout box. This will make a solid box. If you want to make a box with some contents inside, use the style paramenter of one of the subgroup functions (BeginHorizontal, BeginVertical, etc...).
JavaScripts
// Draws a texture and a label inside 2 different boxes
var tex : Texture; function OnGUI() { if(!tex) { Debug.LogError("Missing texture, assign a texture in the inspector"); } GUILayout.Box(tex); GUILayout.Box("This is an sized label"); } using UnityEngine;
using System.Collections; public class example : MonoBehaviour { public Texture tex; void OnGUI() { if (!tex) Debug.LogError("Missing texture, assign a texture in the inspector"); GUILayout.Box(tex); GUILayout.Box("This is an sized label"); } } import UnityEngine
import System.Collections class example(MonoBehaviour): public tex as Texture def OnGUI(): if not tex: Debug.LogError('Missing texture, assign a texture in the inspector') GUILayout.Box(tex) GUILayout.Box('This is an sized label')
|

