Gizmos.DrawGUITexture 绘制界面纹理

static function DrawGUITexture (screenRect : Rect, texture : Texture, mat : Material = null) : void
static function DrawGUITexture (screenRect : Rect, texture : Texture, leftBorder : int, rightBorder : int, topBorder : int, bottomBorder : int, mat : Material = null) : void

Description描述

Draw a texture in screen coordinates. Useful for GUI backgrounds.

在屏幕坐标绘制一个纹理。作为GUI的背景很有用的。

using UnityEngine;

using System.Collections;



public class example : MonoBehaviour {

	public Texture myTexture;

	void OnDrawGizmos() {

		Gizmos.DrawGUITexture(new Rect(10, 10, 20, 20), myTexture);

	}

}
var myTexture : Texture;



function OnDrawGizmos () {

	Gizmos.DrawGUITexture(Rect(0, 0, 20, 20), myTexture);

}
Page last updated: 2010-12-26