How do I add a texture to a button that fills the entire button and not just a portion of it?
Right now I have my code set up as:
if (drawButon(btn_Begin, new GUIContent("Begin", _ButtonTexture)))
{
//Logic here...
}
// I created this method to simplify the creation of GUI buttons. All I have to do is call it and pass the necessary values into the parameters
bool drawButon(Rect rect, GUIContent content)
{
if (GUI.Button(new Rect(GUIRectWindow.x + rect.x, GUIRectWindow.y + rect.y, rect.width, rect.height), content))
{
return true;
}
return false;
}
The GUI button width and height is 100 x 50 and the texture I created is the same width and height so I figured it would fit just fine but All I get is:
[22040-button+error.png|22040]
And I want:
Can anyone help me figure out how to get the GUI texture to fill in the button.