- Home /
Buttons and images
I have a button that uses an image that is 8x8 in size, and it causes the image to be very small on the button, is there a way to manipulate a GuiStyle or something in script that can have the image take the up the whole button regardless of its size?
Comment
Best Answer
Answer by Joyrider · Aug 13, 2013 at 11:46 PM
Create a GUISkin asset, and change the button-GUIStyle's padding parameters to 0 for all 4 sides.
Then when creating your button, reference that skin's button as the style you want to apply to the button.
public GUISkin mySkin;
...
if(GUI.Button(myRect,myImage,mySkin.button))
{
}
Your answer
Follow this Question
Related Questions
Make more buttons appear, on button click. 1 Answer
Null reference exception[SOLVED] 1 Answer
Button Texture Issues?? 1 Answer
proper inventory system issue.. 1 Answer
how to change a gui button texture 1 Answer