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.

GUIStyle

class in UnityEngine

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

Descripción

Styling information for GUI elements.

Most GUI functions accept an optional GUIStyle parameter to override the default style. This allows coloring, fonts and other details to be changed and switched for different states (eg, when the mouse is hovering over the control). Where a consistent look-and-feel is required over a whole GUI design, the GUISkin class is a useful way to collect a set of GUIStyle settings and apply them all at once.

Variables Estáticas

noneShortcut for an empty GUIStyle.

Variables

activeRendering settings for when the control is pressed down.
alignmentText alignment.
borderThe borders of all background images.
clippingWhat to do when the contents to be rendered is too large to fit within the area given.
contentOffsetPixel offset to apply to the content of this GUIstyle.
fixedHeightIf non-0, any GUI elements rendered with this style will have the height specified here.
fixedWidthIf non-0, any GUI elements rendered with this style will have the width specified here.
focusedRendering settings for when the element has keyboard focus.
fontThe font to use for rendering. If null, the default font for the current GUISkin is used instead.
fontSizeThe font size to use (for dynamic fonts).
fontStyleThe font style to use (for dynamic fonts).
hoverRendering settings for when the mouse is hovering over the control.
imagePositionHow image and text of the GUIContent is combined.
lineHeightThe height of one line of text with this style, measured in pixels. (Read Only)
marginThe margins between elements rendered in this style and any other GUI elements.
nameThe name of this GUIStyle. Used for getting them based on name.
normalRendering settings for when the component is displayed normally.
onActiveRendering settings for when the element is turned on and pressed down.
onFocusedRendering settings for when the element has keyboard and is turned on.
onHoverRendering settings for when the control is turned on and the mouse is hovering it.
onNormalRendering settings for when the control is turned on.
overflowExtra space to be added to the background image.
paddingSpace from the edge of GUIStyle to the start of the contents.
richTextEnable HTML-style tags for Text Formatting Markup.
stretchHeightCan GUI elements of this style be stretched vertically for better layout?
stretchWidthCan GUI elements of this style be stretched horizontally for better layouting?
wordWrapShould the text be wordwrapped?

Constructores

GUIStyleConstructor for empty GUIStyle.

Funciones Públicas

CalcHeightHow tall this element will be when rendered with content and a specific width.
CalcMinMaxWidthCalculate the minimum and maximum widths for this style rendered with content.
CalcScreenSizeCalculate the size of an element formatted with this style, and a given space to content.
CalcSizeCalculate the size of a some content if it is rendered with this style.
DrawDraw this GUIStyle on to the screen, internal version.
DrawCursorDraw this GUIStyle with selected content.
DrawWithTextSelectionDraw this GUIStyle with selected content.
GetCursorPixelPositionGet the pixel position of a given string index.
GetCursorStringIndexGet the cursor position (indexing into contents.text) when the user clicked at cursorPixelPosition.

Operadores

GUIStyleGet a named GUI style from the current skin.