GUIStyle 界面样式

Style settings for a GUI element.

用于界面元素的样式设置。

This class contains all information for how a gui element should be rendered. It contains information for font, icon placement, background images, and spacing. It does not contain information for what it contains - just defines how any text rendered with this style should be displayed. It does not define what interactions can occur with the element, but defines the display settings commonly used in by the interactions.

这个类包含用于界面元素如何渲染的所有信息。它包含用于字体、图标位置、背景图片和间距。它不包含对于它包含什么的信息 - 仅仅定义用这个样式显示的文本如何被渲染。它不定义对于这个元素可以发生什么交互,但是定义常用于交互的显示设置。

The settings of a GUIStyle. It is modelled after a CSS Style. It contains settings for the following items:

一个GUIStyle的设置,它类似于CSS样式。它包含以下项目设置:

Background images 背景图片
These are rendered behind the contents. Different images can be assigned for normal display, when the user hovers the mouse over the element, when the user presses it down - as well as alternatives for when the element has been turned on - like toggle butons do. Below, these are referred to as style states. See Also: normal, hover, active, onNormal, onHover, onActive - these contain the background image & text color properties for each state.
这些是被渲染在内容的后面。不同的图片可以指定为正常显示,当用户鼠标悬停在元素之上时,当用户鼠标按下时,以及当元素打开时 - 像toggle按钮。以下这些被称为样式状态,参见:normal, hover, active, onNormal, onHover, onActive - 这些每个状态包含背景图片和文本颜色属性。
Text rendering 文本渲染
The style can define a font for text rendering, as well as alignment, wordwrap and clipping settings. It also defines colors for the text in the various states of the style element See Also: font, alignment, wordWrap, normal, hover, active, onHover, onActive
该样式可以定义一个渲染的文本字体,以及对齐,自动换行和剪裁区域设置。它还定义了文本的样式元素的各种状态的颜色。参见:font, alignment, wordWrap, normal, hover, active, onHover, onActive
Icon Placement 图标位置
GUIStyles can be rendered with either text, and icon or both. The GUIStyle defines where these two are rendered in relation to each other (or can force it to only display one of them). See Also: imagePosition
GUIStyle可以渲染文本和图标或两者。该GUIStyle定义了这个两个相互关系的渲染(或者可以强制它只能显示其中的一个)。参见:imagePosition
Sizing and Spacing Options 调整大小和间距选项
GUIStyles contain padding, margins and borders. These corresponds loosely to the similar named CSS properties. A GUIStyle can optionally define a fixed width and height. See Also: margin, padding, border, fixedWidth, fixedHeight
该GUIStyle包含padding(内边距)、margin(外边距)和border(边框)。这些属性对应类似于CSS属性命名。一个GUIStyle可以定义一个固定的宽度和高度。参见:margin, padding, border

Variables变量

Constructors构造器

Functions函数

Class Variables类变量

Class Functions类函数

最后修改:2011年1月24日 Monday 0:38

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。