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

Parámetros

screenRectEl tamaño y posición de la textura en la "pantalla" se define por el plano XY.
textureLa textura en ser mostrada.
matUn material opcional aplicado a la textura.
leftBorderInsertar desde el borde izquierdo del rectángulo.
rightBorderInsertar desde el borde derecho del rectángulo.
topBorderInsertar desde el borde superior del rectángulo.
bottomBorderInsertar desde el borde inferior del rectángulo.

Descripción

Pintar una textura en la escena.

The chosen texture is drawn in 3D space on a "screen" defined by the XY plane (ie, the plane where the Z coordinate is zero). The values of the texture rectangle are given in scene units. The optional border values specify an inset from each edge within the rectangle in scene units; the texture is drawn inside the inset rectangle and the edge pixels are repeated outwards. This is a useful quick way to create a large background region around the main texture when its edges are of a single colour.

This function can be useful for creating GUI backgrounds in conjunction with a camera pointing directly at the texture.

    var myTexture : Texture;

function OnDrawGizmos () { Gizmos.DrawGUITexture(Rect(10, 10, 20, 20), myTexture); }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961