GUISkin
.font
Manual
Reference
Scripting
Scripting
>
Runtime Classes
>
GUISkin
GUISkin
.font
Menu
Overview
Runtime Classes
Attributes
Enumerations
Editor Classes
Enumerations
History
Index
GUISkin
All Members
Variables
box
button
customStyles
font
horizontalScrollbar
horizontalScrollbarLeftButton
horizontalScrollbarRightButton
horizontalScrollbarThumb
horizontalSlider
horizontalSliderThumb
label
scrollView
settings
textArea
textField
toggle
verticalScrollbar
verticalScrollbarDownButton
verticalScrollbarThumb
verticalScrollbarUpButton
verticalSlider
verticalSliderThumb
window
Functions
FindStyle
GetStyle
Inherited Variables
hideFlags
name
Inherited Functions
GetInstanceID
ToString
Inherited Class Functions
CreateInstance
CreateInstance.<T>
Destroy
DestroyImmediate
DontDestroyOnLoad
FindObjectOfType
FindObjectsOfType
Instantiate
Instantiate.<T>
operator !=
operator ==
operator bool
var
font :
Font
Description
The default font to use for all styles.
JavaScripts
JavaScript
C#
Boo
// Modifies the font only of the current 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"
);
}
using UnityEngine;
using System.Collections;
public
class
example :
MonoBehaviour
{
public
Font
f;
void
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"
);
}
}
import
UnityEngine
import
System.Collections
class
example(
MonoBehaviour
):
public
f as
Font
def
OnGUI
():
if
not 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')