GUISkin
- box
- button
- customStyles
- FindStyle
- font
- GetStyle
- horizontalScrollbarLeftButton
- horizontalScrollbarRightButton
- horizontalScrollbarThumb
- horizontalScrollbar
- horizontalSliderThumb
- horizontalSlider
- label
- scrollView
- settings
- textArea
- textField
- toggle
- verticalScrollbarDownButton
- verticalScrollbarThumb
- verticalScrollbarUpButton
- verticalScrollbar
- verticalSliderThumb
- verticalSlider
- window
GUISkin.font 字体
var font : Font
Description描述
The default font to use for all styles.
用于所有样式的默认字体。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Font f;
void OnGUI() {
if (!typeof(f)) {
Debug.LogError("No font found, assign one in the inspector.");
return;
}
GUI.skin.font = f;
GUILayout.Label("This is a label with the font");
GUILayout.Button("And this is a button");
}
}
// Modifies the font only of the current GUISkin.
//修改当前GUISkin的字体
var f : Font;
function OnGUI() {
if(!f) {
Debug.LogError("No font found, assign one in the inspector.");
return;
}
GUI.skin.font = f;
GUILayout.Label("This is a label with the font");
GUILayout.Button("And this is a button");
}
最后修改:2011年1月25日 Tuesday 13:46