Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

GUILayout.BeginArea

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public static function BeginArea(screenRect: Rect): void;
public static void BeginArea(Rect screenRect);
public static function BeginArea(screenRect: Rect, text: string): void;
public static void BeginArea(Rect screenRect, string text);
public static function BeginArea(screenRect: Rect, image: Texture): void;
public static void BeginArea(Rect screenRect, Texture image);
public static function BeginArea(screenRect: Rect, content: GUIContent): void;
public static void BeginArea(Rect screenRect, GUIContent content);
public static function BeginArea(screenRect: Rect, style: GUIStyle): void;
public static void BeginArea(Rect screenRect, GUIStyle style);
public static function BeginArea(screenRect: Rect, text: string, style: GUIStyle): void;
public static void BeginArea(Rect screenRect, string text, GUIStyle style);
public static function BeginArea(screenRect: Rect, image: Texture, style: GUIStyle): void;
public static void BeginArea(Rect screenRect, Texture image, GUIStyle style);
public static function BeginArea(screenRect: Rect, content: GUIContent, style: GUIStyle): void;
public static void BeginArea(Rect screenRect, GUIContent content, GUIStyle style);

Parámetros

text Optional text to display in the area.
image Optional texture to display in the area.
content Optional text, image and tooltip top display for this area.
style The style to use. If left out, the empty GUIStyle (GUIStyle.none) is used, giving a transparent background.

Descripción

Begin a GUILayout block of GUI controls in a fixed screen area.

By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

See Also: EndArea


Explained Area of the example.

	function OnGUI () {
		// Starts an area to draw elements
		GUILayout.BeginArea (Rect (10,10,100,100));
		GUILayout.Button ("Click me");
		GUILayout.Button ("Or me");
		GUILayout.EndArea ();
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnGUI() { GUILayout.BeginArea(new Rect(10, 10, 100, 100)); GUILayout.Button("Click me"); GUILayout.Button("Or me"); GUILayout.EndArea(); } }

This function is very useful when mixing GUILayout code. It must be matched with a call to EndArea. BeginArea / EndArea cannot be nested.