static function Box (position : Rect, content : GUIContent, style : GUIStyle) : void
Parameters
| Name | Description |
| position |
Rectangle on the screen to use for the box.
|
| text |
Text to display on the box.
|
| image |
Texture to display on the box.
|
| content |
Text, image and tooltip for this box.
|
| style |
The style to use. If left out, the box style from the current GUISkin is used.
|
Description
Make a graphical box.
function OnGUI() {
GUI.Box(Rect(0,0,Screen.width,Screen.height),"This is a title");
}
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "This is a title");
}
}
import UnityEngine
import System.Collections
class example(MonoBehaviour):
def OnGUI():
GUI.Box(Rect(0, 0, Screen.width, Screen.height), 'This is a title')