Created
October 27, 2012 16:10
-
-
Save nakamura001/3965190 to your computer and use it in GitHub Desktop.
Dynamicフォントでフォントサイズを変更するサンプル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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