Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

GUISkin.box

var box: GUIStyle;
GUIStyle box;
box as GUIStyle

Description

Style used by default for GUI.Box controls.

	// Modifies only the box style of the current GUISkin

var style : GUIStyle;

function OnGUI() { GUI.skin.box = style; GUILayout.Box("This is a box."); }

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public GUIStyle style;
    void OnGUI() {
        GUI.skin.box = style;
        GUILayout.Box("This is a box.");
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	public style as GUIStyle

	def OnGUI() as void:
		GUI.skin.box = style
		GUILayout.Box('This is a box.')