Skip to content

Instantly share code, notes, and snippets.

@nakamura001
Created October 27, 2012 16:10
Show Gist options
  • Save nakamura001/3965190 to your computer and use it in GitHub Desktop.
Save nakamura001/3965190 to your computer and use it in GitHub Desktop.
Dynamicフォントでフォントサイズを変更するサンプル
public class Test : MonoBehaviour {
public Font f;
private bool change = false;
void OnGUI ()
{
GUIStyle style = new GUIStyle ();
style.font = f;
if (GUI.Button (new Rect (10, 5, 100, 50), "test")) {
change = true;
}
if (change) {
style.fontSize = 64;
} else {
style.fontSize = 16;
}
GUI.Label (new Rect (15, 110, 200, 50), "fontSize:"+ style.fontSize, style);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment