GUIStyle
- 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.margin 外边距
var margin : RectOffset
Description描述
The margins between elements rendered in this style and any other GUI elements
外边距是指在这个样式渲染的元素和任何其他GUI元素之间的间距
This only has effect when using automatic layout (See Also: GUILayout).
这个仅影响在使用自动布局的时候。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
private RectOffset rctOff;
void OnGUI() {
if (GUI.skin.customStyles.Length > 0) {
rctOff = GUI.skin.customStyles[0].margin;
Debug.Log("Left: " + rctOff.left + " Right: " + rctOff.right);
Debug.Log("Top: " + rctOff.top + " Bottom: " + rctOff.bottom);
}
}
}
// Prints the left, right, top and down values of the GUIStyle margin
//打印GUIStyle外边距的left, right, top 和 down的值
private var rctOff : RectOffset;
function OnGUI() {
if(GUI.skin.customStyles.Length > 0) {
rctOff = GUI.skin.customStyles[0].margin;
Debug.Log("Left: " + rctOff.left + " Right: " + rctOff.right);
Debug.Log("Top: " + rctOff.top + " Bottom: " + rctOff.bottom);
}
}
最后修改:2011年1月20日 Thursday 20:02