- active
- alignment
- border
- CalcHeight
- CalcMinMaxWidth
- CalcScreenSize
- CalcSize
- clipping
- contentOffset
- DrawCursor
- DrawWithTextSelection
- Draw
- fixedHeight
- fixedWidth
- focused
- fontSize
- fontStyle
- font
- GetCursorPixelPosition
- GetCursorStringIndex
- GUIStyle
- hover
- imagePosition
- lineHeight
- margin
- name
- none
- normal
- onActive
- onFocused
- onHover
- onNormal
- operator GUIStyle
- overflow
- padding
- stretchHeight
- stretchWidth
- wordWrap
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变量
-
The name of this GUIStyle. Used for getting them based on name....
这个GUIStyle的名字。用于获取基于名字的样式。 -
Rendering settings for when the component is displayed normally.
用于该组件正常显示时的渲染设置。 -
Rendering settings for when the mouse is hovering over the control
用于当鼠标悬停在控件之上时的渲染设置。 -
Rendering settings for when the control is pressed down.
用于当控件被鼠标按下时的渲染设置。 -
Rendering settings for when the control is turned on.
用于当控件被打开时的渲染设置。 -
Rendering settings for when the control is turned on and the mouse is hovering it.
用于当控件被打开并且鼠标悬停在上面时的渲染设置。 -
Rendering settings for when the element is turned on and pressed down.
用于当元素被打开并且被按下时的渲染设置。 -
Rendering settings for when the element has keyboard focus.
用于当元素有键盘焦点时的渲染设置。 -
Rendering settings for when the element has keyboard and is turned on.
用于当元素有键盘焦点并且被打开时的渲染设置。 -
The borders of all background images.
所有背景图片的边框。 -
The margins between elements rendered in this style and any other GUI elements
外边距是指在这个样式渲染的元素和任何其他GUI元素之间的间距 -
Space from the edge of GUIStyle to the start of the contents.
从GUIStyle边界到内容开始的间距。 -
Extra space to be added to the background image.
添加到背景图片的额外空间。 -
The font to use for rendering. If null, the default font for the current GUISkin is used instead.
用于渲染的字体,如果为null,当前的GUISkin的默认字体将被使用。 -
How image and text of the GUIContent is combined.
GUIContent的图片和文本如何组合。 -
Text alignment.
文本对齐。 -
Word wrap the text?
文本要自动换行么? -
What to do when the contents to be rendered is too large to fit within the area given.
当渲染的内容太大而不能匹配给定的区域内时,使用这个。 -
Pixel offset to apply to the content of this GUIstyle
像素偏移适用于这个GUIstyle内容。 -
If non-0, any GUI elements rendered with this style will have the width specified here.
如果为非0,任意这个类型的渲染的GUI元素将具有这里指定的宽度。 -
The font size to use (for dynamic fonts)
使用字体大小(用于动态字体) -
The font style to use (for dynamic fonts)
使用字体样式(用于动态字体) -
If non-0, any GUI elements rendered with this style will have the height specified here.
如果为非0,任意这个类型的渲染的GUI元素将具有这里指定的高度。 -
Can GUI elements of this style be stretched horizontally for better layouting?
为更好的布局这个样式的GUI元素可以水平拉伸么? -
Can GUI elements of this style be stretched vertically for better layouting?
为更好的布局这个样式的GUI元素可以垂直拉伸么? -
The height of one line of text with this style, measured in pixels. (Read Only)
这个样式的文本一行的高度,以像素计算。(只读)
Constructors构造器
-
Constructor for empty GUIStyle.
构造空的GUIStyle
Functions函数
-
Draw plain GUIStyle without text nor image.
绘制不包含文本也不图像的普通GUIStyle。 -
Draw this GUIStyle with selected content.
绘制这个选择内容的GUIStyle。 -
Draw this GUIStyle with selected content.
绘制这个选择内容的GUIStyle。 -
Get the pixel position of a given string index.
获取给定字符串索引的像素位置。 -
Get the cursor position (indexing into contents.text) when the user clicked at cursorPixelPosition
当用户在cursorPixelPosition点击,获取光标位置(索引到contents.text) -
Calculate the size of a some content if it is rendered with this style.
计算该样式渲染的一些内容的大小。 -
Calculate the size of an element formatted with this style, and a given space to content.
计算该样式已格式化元素的大小,并且给内容一个给定空间。 -
How tall this element will be when rendered with content and a specific width.
这个元素有多高,将在特定的内容和宽度渲染。 -
Calculate the minimum and maximum widths for this style rendered with content.
计算这个样式渲染内容的最小最大宽度。
Class Variables类变量
-
Shortcut for an empty GUIStyle.
空GUIStyle的简码。
Class Functions类函数
-
Get a named GUI style from the current skin.
从当前的皮肤获取一个已命名的GUI样式。