Unityでボタンのサイズを変えたいのですが、どうすればいいのかが分かりません。ボタンサイズが小さいので、大きくしたいと思っています。
調べたのですが、GUILayout.Buttonを使うくらいしか、情報が出て来ませんでした。
教えていただけるとありがたいです。
回答をよろしくお願いします。
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4using UnityEngine.SceneManagement; 5 6public class TitleButtons : MonoBehaviour { 7 8 public void OnGUI(){ 9 10 11 12 if (GUI.Button (new Rect (Screen.width / 2 - 50, Screen.height / 2, 100, 30), "Play Game")) 13 { 14 SceneManager.LoadScene (1); 15 } 16 if (GUI.Button (new Rect (Screen.width / 2 - 50, Screen.height / 2 + 40, 100, 30), "Quit Game")) { 17 Application.Quit (); 18 } 19 } 20 21 22 // Use this for initialization 23 void Start () { 24 25 } 26 27 // Update is called once per frame 28 void Update () { 29 30 } 31} 32
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/12/03 07:27