반응형
유니티 OnGui 글자 크기, 색상 예제 Unity OnGui Text font size, color tutorial
반응형
#define GUI
using UnityEngine;
public class KC_ongui : MonoBehaviour
{
#if GUI
GUIStyle style = new GUIStyle();
float rect_pos_x = 5f;
float rect_pos_y = 5f;
float w = Screen.width;
float h = 20f;
private void Awake()
{
DontDestroyOnLoad(gameObject);
style.normal.textColor = Color.green;
style.fontSize = 19;
}
private void OnGUI()
{
GUI.Label(new Rect(rect_pos_x, rect_pos_y, w, h), "text_01", style);
GUI.Label(new Rect(rect_pos_x, rect_pos_y + h * 1, w, h), "text_02", style);
GUI.Label(new Rect(rect_pos_x, rect_pos_y + h * 2, w, h), "text_03", style);
}
#endif
}
반응형