用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:guistyle:guistyle

GUIStyle 界面样式

class in UnityEngine

Description 描述

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.

大多数GUI功能接受GUIStyle选项参数去覆盖默认的样式。该功能允许颜色,字体和其他细节被改变并且转换不同的状态(即,当鼠标悬停在控件之上)。在整个GUI设计中需要一个一致的外观和感觉,GUISkin类是一个有用的方法来收集一组GUIStyle设置和应用它们。

Static Variables 静态变量

noneShortcut for an empty GUIStyle.
空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.
像素偏移适用于这个GUIstyle内容。
fixedHeightIf non-0, any GUI elements rendered with this style will have the height specified here.
如果为非0,任意这个类型的渲染的GUI元素将具有这里指定的高度。
fixedWidthIf non-0, any GUI elements rendered with this style will have the width specified here.
如果为非0,任意这个类型的渲染的GUI元素将具有这里指定的宽度。
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.
用于渲染的字体,如果为null,当前的GUISkin的默认字体将被使用。
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.
GUIContent的图片和文本如何组合。
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.
外边距是指在这个样式渲染的元素和任何其他GUI元素之间的间距
nameThe name of this GUIStyle. Used for getting them based on name.
这个GUIStyle的名字。用于获取基于名字的样式。
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.
从GUIStyle边界到内容开始的间距。
richTextEnable HTML-style tags for Text Formatting Markup.
启用HTML样式标签的文本格式标记。
stretchHeightCan GUI elements of this style be stretched vertically for better layout?
为更好的布局这个样式的GUI元素可以垂直拉伸么?
stretchWidthCan GUI elements of this style be stretched horizontally for better layouting?
为更好的布局这个样式的GUI元素可以水平拉伸么?
wordWrapShould the text be wordwrapped?
文本要自动换行么?

Constructors 构造

GUIStyleConstructor for empty GUIStyle.
构造空的GUIStyle

Public Functions 公共函数

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.
在屏幕上绘制GUIStyle ,内部版本。
DrawCursorDraw this GUIStyle with selected content.
绘制这个选择内容的GUIStyle。
DrawWithTextSelectionDraw this GUIStyle with selected content.
绘制这个选择内容的GUIStyle。
GetCursorPixelPositionGet the pixel position of a given string index.
获取给定字符串索引的像素位置。
GetCursorStringIndexGet the cursor position (indexing into contents.text) when the user clicked at cursorPixelPosition.
当用户在cursorPixelPosition点击,获取光标位置(索引到contents.text)

Operators 运算符

GUIStyleGet a named GUI style from the current skin.
从当前的皮肤获取一个已命名的GUI样式。
script/unityengine/classes/guistyle/guistyle.txt · 最后更改: 2016/08/02 05:30 (外部编辑)