- Home /
Question by
davidflynn2 · Nov 02, 2012 at 03:24 PM ·
c#guitexturebutton
GUI Button Texture only showing as small
I have the following code set up for my GUI button and the texture is only showing realy small in on corner of my button. This is the code:
public Texture Location5Button;
if (GUI.Button(new Rect(230, 70, 50, 30), new GUIContent("Click", Location5Button)))
Comment
Nither witch would be best to use I have never used GUISkin
Answer by coastwise · Nov 02, 2012 at 03:46 PM
Try using GUILayout instead of GUI. That way you don't need to specify a rectangle and the button takes as much room as necessary.
if (GUILayout.Button(new GUIContent("Click", Location5Button))) {
Debug.Log("clicked");
}
PS: can you please accept answers to you other questions when they solve your problems
Your answer
Follow this Question
Related Questions
Make more buttons appear, on button click. 1 Answer
Null reference exception[SOLVED] 1 Answer
Setting tooltip text depending on condition 1 Answer
Key for GUI.Button 2 Answers
Equivelant of GUI.DrawSprite() ? 0 Answers