- Home /
GUI Button make text bigger.
I've got a big GUI.Button , but the text inside it is really small . Is there anyway I can make it bigger ?
Answer by CHPedersen · Sep 02, 2013 at 07:46 PM
Sure, try to play around with the button's GUIStyle when you draw it. It has a fontsize property you can change, see docs:
http://docs.unity3d.com/Documentation/ScriptReference/GUIStyle-fontSize.html
Not having seen your code, I don't know how you're drawing buttons right now, but GUI.Button has an overload that takes a custom GUIStyle. If you don't use that overload, it will use the default button style. So you may need to create a new GUIStyle using the default one as the template and then edit the fontsize. Here's a totally untested pseudo-code snippet to give you an idea:
GUIStyle customButton = new GUIStyle("button");
customButton.fontSize = whatever you want it to be;
if(GUI.Button(Rect, customButton)) ...
Your "untested pseudo-code" works pretty well!!!
Thank You!!!
Answer by PlasmaRaven · Mar 19, 2020 at 10:27 AM
how do i make my button text bigger my gui button layout is like this
bool flag20 = GUI.Button(new Rect(Screen.width - 100, 950f, 80f, 60f), "OPEN");
with out loosing the box it self thats around my button gray box
Your answer
Follow this Question
Related Questions
GUI Button to toggle true false when pressed 1 Answer
button pressed twice / Conversation text skip 5 Answers
GUI problem 1 Answer
how can i change the gui button on runtime?? 1 Answer
Touches aren't working on Android 1 Answer