GUI.Box绘制纹理

static function Box (position : Rect, text : string) : void
static function Box (position : Rect, image : Texture) : void
static function Box (position : Rect, content : GUIContent) : void
static function Box (position : Rect, text : string, style : GUIStyle) : void
static function Box (position : Rect, image : Texture, style : GUIStyle) : void
static function Box (position : Rect, content : GUIContent, style : GUIStyle) : void

Parameters参数

Description描述

Make a graphical box.

创建一个图形盒子。

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");
	}
}
//创建一个屏幕大小的盒子
function OnGUI() {
	GUI.Box(Rect(0,0,Screen.width,Screen.height),"This is a title");
}
Page last updated: 2011-1-14