Hi,
Bellow are two square textures applied to 2 buttons. Why, in the 1st, the texture is stretched, and not in the second ? Only the top right corner is different.


Hi,
Bellow are two square textures applied to 2 buttons. Why, in the 1st, the texture is stretched, and not in the second ? Only the top right corner is different.


The GUIStyle used by the button defines (amongst many others) the border size of the image. This border is the amount of pixels in the background image that should not be stretched.
The style you use simply does not have the top and right values set high enough to avoid stretching of the corner.
See:
(check for the GUIStyle.border)
Thank you very much !